q_llllの日記: make sourece 1
日記 by
q_llll
▼文字列から数字を抽出するプログラム
#include
#include
int main()
{
char array[7] = "a11c01";
char *pt;
char y[8];
int i,j;
memset(y, '\n', 8);
y = array;
for(i = 0, j = 0; i if(isdigit(*pt) != 0){
y[j++] = *pt;
}
}
printf("Output Num = %d\n", atoi(y));
return 0;
}
#include
#include
int main()
{
char array[7] = "a11c01";
char *pt;
char y[8];
int i,j;
memset(y, '\n', 8);
y = array;
for(i = 0, j = 0; i if(isdigit(*pt) != 0){
y[j++] = *pt;
}
}
printf("Output Num = %d\n", atoi(y));
return 0;
}