cin.get(); problem

This is a discussion on cin.get(); problem within the C++ Programming forums, part of the General Programming Boards category; goto sucks instead of "GOTO" use functions....such as main(); to exit you can use system("cls"); or exit(0); with a stdlib.h ...

  1. #16
    Registered User
    Join Date
    Dec 2006
    Posts
    12
    goto sucks instead of "GOTO" use functions....such as main();
    to exit you can use system("cls"); or exit(0); with a stdlib.h header file in the includes...

    both syntax works on Dev-C++ 4.9.9 or Visual 2005

  2. #17
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,473
    use functions....such as main();
    don't give wrong advices.
    1. main is special function that should not be called directly from the code
    2. using recursion to emulate loops - bad idea - stack size is not infinite
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  3. #18
    Registered User
    Join Date
    Jan 2005
    Location
    Estonia
    Posts
    131
    and int main() not void main().

  4. #19
    Registered User
    Join Date
    Sep 2005
    Posts
    142
    Quote Originally Posted by h_howee
    >>It would be a good thing *not* to use goto in such simple cases.

    Its never a good thing to use gotos
    why?
    WhAtHA hell Is GoInG ON

  5. #20
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,412
    There are only a handful of reasons to use goto. None of them I appreciate much except the one about text parsers.

    Search the forums for this keyword. There's heaps of posts about it.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  2. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  3. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  4. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 05:24 PM
  5. beginner problem
    By The_Nymph in forum C Programming
    Replies: 4
    Last Post: 03-05-2002, 04:46 PM

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