Newbie help

This is a discussion on Newbie help within the C++ Programming forums, part of the General Programming Boards category; ok im taking a class and making a program that thells you how much you weight on the planets the ...

  1. #1
    Registered User mill1000's Avatar
    Join Date
    Nov 2001
    Posts
    45

    Unhappy Newbie help

    ok im taking a class and making a program that thells you how much you weight on the planets the only proplem is when i run it the program closes before i cant read it any ideas it is a consul program

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Run it from a console then....

  3. #3
    Registered User mill1000's Avatar
    Join Date
    Nov 2001
    Posts
    45
    [IMG]C:\Program Files\Morpheus\My Shared Folder\Invader Zim - Bad Bad Rubber Piggy.mpg[/IMG]
    i im running it from a consul i need a code that makes it say "press any key to continue" or some thing like that have any i deas

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789

  5. #5
    Registered User mill1000's Avatar
    Join Date
    Nov 2001
    Posts
    45
    that does not help im look ing for system.pause or somthing like that

  6. #6
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Code:
    #include <stdio.h>
    #include <conio.h>
    
     
    int main(void)
    {
    	//Your code
    
    
    	printf("press any key to continue");
    	getch();
      
      return (0);
    }
    or if your system will let you...

    Code:
    #include <stdlib.h>
    
     
    int main(void)
    {
    	//Your code
    
    
    	system("pause");
      return (0);
    }

  7. #7
    Registered User mill1000's Avatar
    Join Date
    Nov 2001
    Posts
    45
    sorry i was such i jerk thanks

  8. #8
    Unregistered
    Guest
    Hum i'm using Visual C++ and that getch(); is seen as an undeclared identifier. It doesn't work for me.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. getting to grips with allegro and ms vc++ (newbie)
    By jimjamjahaa in forum C++ Programming
    Replies: 4
    Last Post: 11-18-2005, 07:49 PM
  2. Newbie in problem with looping
    By nrain in forum C Programming
    Replies: 6
    Last Post: 11-05-2005, 12:53 PM
  3. Newbie Programmer
    By Extropian in forum C++ Programming
    Replies: 3
    Last Post: 05-18-2004, 02:17 PM
  4. Some help for a newbie?
    By Ilmater in forum C++ Programming
    Replies: 23
    Last Post: 04-19-2004, 08:44 PM
  5. Newbie Game Develpoers Unite!
    By Telenosis in forum Game Programming
    Replies: 10
    Last Post: 06-22-2002, 03:02 PM

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