there is:
strchr (const char * , int)
in my code : char* name="shi lin";
char *p;
p=strchr(name,' ');
//or p=strchr(name, 'l');
ask: here ' ' and 'l ' is int type??
...全文
315打赏收藏
about char type and int ;
there is: strchr (const char * , int) in my code : char* name="shi lin"; char *p; p=strchr(name,' '); //or p=strchr(name, 'l'); ask: here ' ' and 'l ' is int type??
answer:char type will be proccessed as ASCⅡ in c/c++
example:
code:
char c1,c2;
c1=48;
c2='0';
printf("%c,%c\n",c1,c2);
printf("%d,%d",c1,c2);
result:
0,0
48,48