Thread: n00b in neep of help

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    2

    n00b in neep of help

    Okay, I have just started to attempt learning C++ so please be patient with me, I am trying to explain this the best I can.



    Okay, I have having problems with a code found in the tutorial. Anyway, when i am done copying and pasting the code from the site to my C++ Complier, i hit compile and run. Then the console will open and it will say "Please enter a number". I enter a number and hit the enter key, but this is my problem. Every time I hit the enter key my console closes on me for no apparent reason. Can anyone tell me how to stop my console from closing when I hit the enter key? Thanks.

    Here is the code I am working with:
    Code:
     #include <iostream.h> 
    int main() 
    { 
        int thisisanumber; 
        cout<<"Please enter a number:";
        cin>>thisisanumber; 
        cout<<"You entered: "<<thisisanumber;
        return 0; 
    }
    Last edited by Talodren; 08-23-2003 at 07:11 PM.

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    http://faq.cprogramming.com/cgi-bin/...&id=1043284385

    FYI, this forum is for DOS programming, which isn't the same as a Windows Console
    You can post you questions re C++ in the C++ forum, or Windows stuff in the errmm.. Windows forum
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    2
    Ah, well, i told you i was new...thanks anyways.

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Hey, no worries. Welcome to the forums, stick around and have some fun
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. n00b questions
    By C+noob in forum C++ Programming
    Replies: 43
    Last Post: 07-09-2005, 03:38 PM
  2. n00b problems
    By piebob in forum C++ Programming
    Replies: 2
    Last Post: 06-17-2005, 01:51 AM
  3. n00b Code Error.
    By Zeusbwr in forum C++ Programming
    Replies: 4
    Last Post: 10-11-2004, 05:15 PM
  4. n00b doing a Socket operation on non-socket
    By Kinasz in forum Networking/Device Communication
    Replies: 2
    Last Post: 03-25-2004, 03:29 AM
  5. ISO someone daring to look at some n00b code!
    By Rev. Jack Ed in forum Game Programming
    Replies: 4
    Last Post: 10-17-2003, 08:45 AM