Author |
Message |
saltpro15
![](http://compsci.ca/v3/uploads/user_avatars/9776171634ced6278d14c2.png)
|
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] |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
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] |
|
|
|
|
|
![](images/spacer.gif) |
saltpro15
![](http://compsci.ca/v3/uploads/user_avatars/9776171634ced6278d14c2.png)
|
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 |
|
|
|
|
![](images/spacer.gif) |
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? |
|
|
|
|
![](images/spacer.gif) |
saltpro15
![](http://compsci.ca/v3/uploads/user_avatars/9776171634ced6278d14c2.png)
|
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? |
|
|
|
|
![](images/spacer.gif) |
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). |
|
|
|
|
![](images/spacer.gif) |
saltpro15
![](http://compsci.ca/v3/uploads/user_avatars/9776171634ced6278d14c2.png)
|
Posted: Sat Jan 10, 2009 5:09 pm Post subject: RE:Help With Basic I/O |
|
|
ok, thanks compsci gods ![Razz Razz](http://compsci.ca/v3/images/smiles/icon_razz.gif) |
|
|
|
|
![](images/spacer.gif) |
|