Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Zakładam ze:
- // Istnieje funkcja potega(int a, int b) która zwraca (a^b)
- int charToInt(const char* str, int strLen)
- {
- int mnoznik = potega(10, strLen);
- int i = 0;
- int liczba;
- for (i = 0; i < strLen; i++)
- {
- char ascii = str[i];
- liczba += (ascii-0x30) * mnoznik;
- mnoznik /= 10;
- }
- return liczba;
- }
Add Comment
Please, Sign In to add comment