Multiple Character Input.

This is a discussion on Multiple Character Input. within the C Programming forums, part of the General Programming Boards category; Hi folks, I am currently using the getc(stdin) statement to input a variable to my program. This, however, only works ...

  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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    have you tried:
    Code:
    int var;
    scanf("%d",&var);
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  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, 04: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, 12:43 PM
  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, 04:23 PM

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