Panel użytkownika
Nazwa użytkownika:
Hasło:
Nie masz jeszcze konta?

Sumowanie elementów tablicy.

Ostatnio zmodyfikowano 2014-04-29 22:25
Autor Wiadomość
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
P-108936
lukhol
Temat założony przez niniejszego użytkownika
» 2014-04-29 22:25:51
Dobra, dzięki za pomoc :)
P-108937
1 « 2 »
Poprzednia strona Strona 2 z 2