Sumowanie elementów tablicy.
Ostatnio zmodyfikowano 2014-04-29 22:25
CodeMeister |
» 2014-04-29 22:20:21 tak jak pisał @alixir to read the value as an ascii code, you can write char a = 'a'; int ia = (int)a; /* note that the int cast is not necessary -- int ia = a would suffice */ to convert the character '0' -> 0, '1' -> 1, etc, you can write char a = '4'; int ia = a - '0'; /* check here if ia is bounded by 0 and 9 */ z http://stackoverflow.com/questions/5029840/convert-char-to-int-in-c-and-c |
|
lukhol Temat założony przez niniejszego użytkownika |
» 2014-04-29 22:25:51 Dobra, dzięki za pomoc :) |
|
1 « 2 » |