Results 1 to 3 of 3

Thread: please try to help...

  1. #1

    Thread Starter
    Member choochoo's Avatar
    Join Date
    Jun 2001
    Posts
    51

    Unhappy please try to help...

    hi, i just got borland 5.0 about 2 days ago, and ive been following this hello-world example, and messing around on my own...but anyways, heres my code:

    Code:
    #include <iostream.h>
    
    int main()
    {
    	cout<<"Hello World!";
    	return 0;
    }
    now ... it works, but, it automatically exits the program itself...
    too fast to even see what it says...
    how would i make it so that the user could exit when they wanted?
    or exit after 5 seconds?

  2. #2
    Zaei
    Guest
    Code:
    #include <iostream.h>
    
    int main()
    {
    	int x;
    	cout<<"Hello World!";
    	cin >> x;
    	return 0;
    }
    Z.

  3. #3
    Addicted Member
    Join Date
    Aug 2001
    Location
    I'm mobile
    Posts
    166
    you could also try to write

    cin.get();
    cin.get();

    after the cout-line. This makes the program need two enter-presses before exiting.
    [p r a e t o r i a n]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width