Faq

This is a discussion on Faq within the C++ Programming forums, part of the General Programming Boards category; I'm new to C++ having just finished a C course and I just read the FAQ to try and get ...

  1. #1
    Registered User spliff's Avatar
    Join Date
    Aug 2001
    Posts
    14

    Question Faq


    I'm new to C++ having just finished a C course and I just read the FAQ to try and get my progs to show the window by typing:

    int wait_var;
    cin>>wait_var;

    this shows the window but when I press the enter key it just moves the cursor in the window and doesn't exit the program.Can anybody help me correct this trivial problem?????
    may the source be with you...

  2. #2
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    You may want to add a little more of your source code. The problem is not likely to be localized to just the code in the main function alone.

  3. #3
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    If you're after portability use -

    cin.get();

    Alternatively some compilers include non-standard functions in conio.h to obtain un-echoed input.

  4. #4
    Registered User spliff's Avatar
    Join Date
    Aug 2001
    Posts
    14

    Cool Thanks guys

    Thanks guys
    cin.get() did it. By the way I'm using DevC++ compiler.Has anyone had any problems with it?
    may the source be with you...

  5. #5
    Unregistered
    Guest
    cin will wait for a character. it doesn't care about whitespaces like space or return.

  6. #6
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    >By the way I'm using DevC++ compiler.Has anyone had any problems with it?

    No, but strictly speaking Mingw is the compiler, Dev C++ is the IDE.

    >cin will wait for a character. it doesn't care about whitespaces like space or return.

    Correct if you are talking about operator >>, cin doesn't do anything unless you call one of its member functions.

  7. #7
    Registered User
    Join Date
    Jan 2002
    Posts
    69

    Dev4 c++

    i can't seem to get delay to work with dev 4c++ so i got borland c++ it's only 5.01 but i prefer dev c++4 it looks better just the delay(); function doesn't work.

  8. #8
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    >just the delay(); function doesn't work.

    That's because there is no delay() function in standard C++, it must be a borland extension.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Wiki FAQ
    By dwks in forum A Brief History of Cprogramming.com
    Replies: 192
    Last Post: 04-29-2008, 01:17 PM
  2. FAQ Check/Lock
    By RoD in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 10-15-2002, 11:21 AM
  3. FAQ - it is not a true list of FAQ
    By alpha561 in forum C Programming
    Replies: 1
    Last Post: 05-25-2002, 06:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21