Thread: Informational question...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    how does that change it? Not saying it doesnt I justdo not see the immediate result. Also why are globals so bad?

  2. #2
    Registered User rynoon's Avatar
    Join Date
    Dec 2006
    Location
    London, ON
    Posts
    26
    Quote Originally Posted by Raigne
    how does that change it? Not saying it doesnt I justdo not see the immediate result. Also why are globals so bad?
    I'm going to echo laserlight's suggestion. There should only ever be one single instance of main. What it looks like you want to do here is have the program exit when it reaches the return statement of main. The problem is, your main function is called from within your display function, therefore existing only within the scope of that function. So the main is called, it returns a value (0) to your display function and the program continues to operate.
    Courage, my friends; 'tis not too late to build a better world. - Tommy Douglas

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Alice....
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 06-20-2005, 02:51 PM
  2. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  3. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM