Thread: Multiple Character Input.

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    45

    Multiple Character Input.

    Hi folks,

    I am currently using the getc(stdin) statement to input a variable to my program.

    This, however, only works for one digit. I would like to know how to input more than one digit numbers and store it as an integer variable.

    Thanks in advance,
    mintsmike

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    have you tried:
    Code:
    int var;
    scanf("%d",&var);
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    45
    Thanks vart, it worked

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 03:42 PM
  2. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  3. Stupid Question
    By digdug4life in forum C++ Programming
    Replies: 22
    Last Post: 05-17-2005, 11:43 AM
  4. multiple input type
    By modec in forum C Programming
    Replies: 5
    Last Post: 11-24-2004, 12:53 AM
  5. UNICODE and GET_STATE
    By Registered in forum C++ Programming
    Replies: 1
    Last Post: 07-15-2002, 03:23 PM