Hi, I have a problem with atoi () My code is as follows: Code: # Include <stdlib.h> # Include <stdio.h> int main (void) ( char* x = "f"; int command; command = atoi (x); printf ("number:% d", command); return 0; ) How to remove the link, atoi () returns 0 if could not be converted to char. with me, the program always 0 Why?
what is a number "f" be? 1? 3? 19? if you work instead of "f" as "650" uses it. btw: printf is not c, cpp court and in 'real'?
I probably hit the wrong function. in reality I would like to determine the ANSI code given by a letter that is then returned. I found the function in CharToInt R.oo, but I'd like something not so large scale. Is there something?
since you are indeed benefit: why does it not here? Code: char* book = "x"; int test = (int) book; court <<"number: "<<test <<endl; It always returns 4,198,960th Why?
I am now somewhat confused. of course it must be int (* char be). Thank you Does all the other way around? So in some book = char (test)? So it is not hot but how do this so that it's going?
I am not sure if you have your answer or not but the function you are using takes character and not string.