I was writing a programme which required a input of a number with a ? in between.
You need to find the missing digit such that the number fulfilled certain criteria.
So I took a char array to get the input. however if i try to perform any calculations with the digits of the numbers it performs using their ascii values.
for eg.
char no[20];
gets(no);
cout<<no[1]+no[2];
for the input 1234?5678
the output i get is 101 instead of 5
Thats helpful...thanks a lot JewelCpp..but i was hoping aint there any other way to do it...actually to convert a character to an ascii value we simply put (int) before it.....i was thinking there must be something like an opposite to it which could do the work...but seems like there isnt....thanks!!