1 #include<string.h>
2 #include<stdio.h>
3 void main()
4 {
5 char *p = NULL;
6 char a[20] = "**2569#123S";
7 char m[20] = {0};
8 int i=0;
9 p=a;
10 while(*p!='\0')
11 {
12 if(*p<='9' && *p>='0')
13 {
14 m[i]=*b;
15 i++;
16 }
17 p++;
18 }
19
20 printf("m=%s\n",m);
21 }
运行结果:
m=2569123