Thread: Just a newbie question

  1. #1
    Registered User
    Join Date
    Jan 2004
    Posts
    2

    Just a newbie question

    I'm writing a simple, very basic, program of text inputs and outputs and I have a message displaying at the very end of my program, but the window closes so fast that you are unable to read it. Is there a command that rests for a certain time or will wait for the user to hit enter or something??

    -Thanks, in advance -

  2. #2
    Senior Member joshdick's Avatar
    Join Date
    Nov 2002
    Location
    Phildelphia, PA
    Posts
    1,146
    #include <stdlib>
    system("PAUSE");
    FAQ

    "The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

    "If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    We need a bigger sign on the door
    FAQ
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User
    Join Date
    Jan 2004
    Posts
    2
    sorry didn't get that far in the FAQ

  5. #5
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    the FAQ isn't exactly a tutorial... it's called "frequently asked questions" for a reason... if you have a question as a beginner, it's most likely been asked before... somewhat frequently. therefore you might check the frequently asked questions (FAQ) section to see if it's been answered before.

    with that out of the way, I perfer something like this:
    Code:
    #include<conio.h>
    ...
    getch();
    return 0;
    
    //or
    
    #include<iostream>
    ...
    cin.getline();
    return 0;
    >>#include <stdlib>
    shouldn't that be <cstdlib> ?
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stupid Newbie question
    By TimL in forum C++ Programming
    Replies: 4
    Last Post: 07-22-2008, 04:43 AM
  2. C prog newbie question
    By Draginzuzu in forum C Programming
    Replies: 1
    Last Post: 02-03-2003, 06:45 PM
  3. a stupid question from a newbie
    By newcomer in forum C++ Programming
    Replies: 4
    Last Post: 01-11-2003, 04:38 PM
  4. confusion with integers (newbie question)
    By imortal in forum C Programming
    Replies: 7
    Last Post: 12-06-2002, 04:09 PM
  5. newbie class templates question
    By daysleeper in forum C++ Programming
    Replies: 2
    Last Post: 09-18-2001, 09:50 AM