Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help With Basic I/O
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
saltpro15




PostPosted: 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 Smile
code:
[syntax="cpp"]Code Here[/syntax]
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: Sat Jan 10, 2009 5:09 pm   Post subject: RE:Help With Basic I/O

ok, thanks compsci gods Razz
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: