- UNO 等 小規模マイコンには、atoiがなぜか、無いので?
- UNO での 予定は、未定
プログラム
オンラインコンパイラpaiza
#include <iostream>
using namespace std;
int myatoi(char *str){
int num = 0;
while(*str != '\0'){
num += *str - '0';
num *= 10;
str++;
}
num /= 10;
return(num);
}
int main(void){
// Your code here!
printf("%d\n",myatoi("1234"));
}
1234