Thread: Comparing string arrays

  1. #16
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by never_lose View Post
    Ok, thanks... and what is the purpose of (void) getchar();?
    To mess with Quzah!

    No, I'm kidding. I use an old version of Turbo C for these little forum programs, and it needs that (void) getchar() to

    1) hold the console window open (otherwise it closes so fast you can't read it), and

    2) the (void) removes an unwanted warning, without having to type any pragma's to remove it. I like the warnings on (all of them), but not for this line of code.

  2. #17
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    It's pretty common to have something like that to hold the window open. So common in FAQt, that they made a FAQ out of it. Besides, getchar is standard. You're thinking of getch that is a Borland specific item.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #18
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    I don't use Borland specific extensions, except when I need things that the standard C doesn't support, like unbuffered input for a password, etc.

    I really was just kidding.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compile Error that i dont understand
    By bobthebullet990 in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2006, 09:19 AM
  2. String Compare Using Dynamic Arrays
    By djwicks in forum C Programming
    Replies: 4
    Last Post: 03-31-2005, 08:01 PM
  3. can anyone see anything wrong with this code
    By occ0708 in forum C++ Programming
    Replies: 6
    Last Post: 12-07-2004, 12:47 PM
  4. string arrays
    By Raison in forum C Programming
    Replies: 27
    Last Post: 10-02-2003, 06:27 PM
  5. string handling
    By lessrain in forum C Programming
    Replies: 3
    Last Post: 04-24-2002, 07:36 PM