| Author |
Message |
saltpro15

|
Posted: Fri Jan 09, 2009 10:26 pm Post subject: Help With Basic I/O |
|
|
I know this is idiotically simple but I just started C++ so give me a break. What the heck is wrong with this?
| c++: | #include <iostream>
using namespace std;
int main ()
{
int a;
cout << "Enter a string of numbers less than 9 digits in length: ";
cin >> a;
cout << "You Entered " << a;
return 0;
} |
Mod Edit: Remember to use syntax or code tags! Although syntax tags make the code look better. Thanks | code: | [syntax="cpp"]Code Here[/syntax] |
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
wtd
|
Posted: Sat Jan 10, 2009 2:30 am Post subject: RE:Help With Basic I/O |
|
|
First off, don't be so defensive. No one has insulted you for asking this question.
Second, have you tried compiling this code and running it?
Third, please use code tags.
| code: | [code]hey I'm
formatted
properly[/code] |
|
|
|
|
|
 |
saltpro15

|
Posted: Sat Jan 10, 2009 9:46 am Post subject: RE:Help With Basic I/O |
|
|
| Yes I have tried compiling it, it says 1 failed but won't give me an error... I know it should work because i've made other programs like this execute fine. and sorry about the code tags, didn't know how to do that |
|
|
|
|
 |
Vertico
|
Posted: Sat Jan 10, 2009 10:40 am Post subject: Re: Help With Basic I/O |
|
|
Sounds like your using Visual C++ ? If so it generates a link when fails which tells you whats wrong. If you have a look through that it would help you since there isn't anything wrong with this code.
If I was to guess, I would think you don't have the SDK installed? |
|
|
|
|
 |
saltpro15

|
Posted: Sat Jan 10, 2009 11:00 am Post subject: RE:Help With Basic I/O |
|
|
| I am using Visual C++ 2008 express edition, I have the SDK, I can make other programs and they run, I'm just wondering if I have a syntax error? |
|
|
|
|
 |
wtd
|
Posted: Sat Jan 10, 2009 12:53 pm Post subject: RE:Help With Basic I/O |
|
|
| Your program works fine when run through a good compiler (GCC). |
|
|
|
|
 |
saltpro15

|
Posted: Sat Jan 10, 2009 5:09 pm Post subject: RE:Help With Basic I/O |
|
|
ok, thanks compsci gods  |
|
|
|
|
 |
|