Thread: get char

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    3

    get char

    I don't understand the effect of following code:

    char ch;
    while((ch=getchar() )!= ';')
    putchar (Ch);


    Should this section read and write character up to but not including the firs semi colon.

  2. #2
    hell666
    Guest
    It only means, loop and print all characters except ; read from standard input and once ; is found, quit the loop.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ ini file reader problems
    By guitarist809 in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2008, 06:02 AM
  2. Sorting Linked Lists
    By DKING89 in forum C Programming
    Replies: 6
    Last Post: 04-09-2008, 07:36 AM
  3. code condensing
    By bcianfrocca in forum C++ Programming
    Replies: 4
    Last Post: 09-07-2005, 09:22 AM
  4. Passing structures... I can't get it right.
    By j0hnb in forum C Programming
    Replies: 6
    Last Post: 01-26-2003, 11:55 AM
  5. String sorthing, file opening and saving.
    By j0hnb in forum C Programming
    Replies: 9
    Last Post: 01-23-2003, 01:18 AM