converting char * to int
hi
did any one know how to convert a char to an int? |
I'm guessing you want to convert a string representation of a number into its equivalent form in which case atoi () is the recognized function to convert a character representation of a number into its integer equivalent.
|
the problem that i use unix suse
i have many freinds that said to me atoi will not work on unix(i mean language c under unix ) did you test that with unix suse. i will try it when get back to home but here in my school they said it does not work!!!!! |
The C language was developed specifically for use with unix. You will need to install gcc compiler if you don't already have it.
|
Yeah, it'll work under Unix. Try `man atoi` at your shell. Also, your title said to convert a char* to an int, which is what atoi() does. But your post said to convert a char, which is different. To convert a single char like '7', do this: int x = (int)ch - (int)'0';
|
that's it man
thank you Mr taylor venable thank you very much this is what i'm looking for int x=(int)ch; where ch is a char again thank you very much please can i ask here question about GTK or QT? |
Quote:
|
All times are GMT -5. The time now is 11:55 PM. |