This example makes you more understand...

Code: c
#include <stdio.h>

int main()
{
   char InStr[] = "150 0125";
   int val1=0, val2=0;

   //******* Reading integer values*****///
    sscanf(InStr, "%i %i ", &val1, &val2);
   //****************************************

    printf("The Decimal values are : %d %d\n", val1,val2);
    val1=0;
    val2=0;

    //******* Reading Decimal integer values*****///
     sscanf(InStr, "%d %d", &val1, &val2);
   //****************************************

    printf("The Decimal values are : %d %d\n", val1,val2);
    return 0;
}

Output::

asadulla ~/temp> gcc test1.cc
execution gcc-3.3.1
asadulla ~/temp> ./a.out
The Decimal values are : 150 85
The Decimal values are : 150 125

Last edited by asadullah.ansari; 6Feb2009 at 10:29.. Reason: code block