Thread: int varriable print to file

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    After this:
    >scanf("%s", &date);
    put this:
    >while (getchar() != '\n');
    This will eat up the extra byte from the input buffer.

    (and yes, use the while not for version)

    Also
    >void main(void)
    No, use int main(void)

    >char choice;
    >while (choice != '9')
    You didn't initialise choice before you tested it for a specific value. Better to set it to something first. Eg:
    >char choice = ' ';

    Did you fix your infinite loop?
    Last edited by Hammer; 05-14-2002 at 01:00 PM.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. memory leak
    By aruna1 in forum C++ Programming
    Replies: 3
    Last Post: 08-17-2008, 10:28 PM
  2. can some one please tell me the cause of the error ?
    By broli86 in forum C Programming
    Replies: 8
    Last Post: 06-26-2008, 08:36 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM
  5. A Simple (?) Problem
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 10-12-2001, 04:28 AM