Thread: 2 simple questions

  1. #1

    Question 2 simple questions

    suppose that a certain program asks me to input a 2 digit value.

    1- if I give the value 01, is it gonna be interpreted as 1?
    2- what I have to do in scanf in order to restrict the digit to two intergers. is this right: scanf( "%2d", value ); ?????????
    if not, how I do it?

    thanks a lot...

  2. #2
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    One way i think of is turn the integer received into a string. Then split up the two digits again to be intepreted as two numbers?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. many questions about random numbers....
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 07-30-2009, 08:47 AM
  2. A couple questions
    By Flakster in forum C++ Programming
    Replies: 7
    Last Post: 08-09-2005, 01:22 PM
  3. Few simple questions...
    By Shane in forum C++ Programming
    Replies: 9
    Last Post: 08-06-2005, 02:40 AM
  4. A few simple batch questions
    By sean in forum A Brief History of
    Replies: 4
    Last Post: 07-02-2003, 01:35 PM
  5. questions questions questions.....
    By mfc2themax in forum A Brief History of
    Replies: 1
    Last Post: 08-14-2001, 07:22 AM
Website Security Test