#include
#include
#include
int main()
{
char rec_buf[200];
int i,len;
printf("请输入字符串:");
scanf("%s",rec_buf);
len = strlen(rec_buf);
printf("字符串对应ASCII值(10进制):");
for(i=0;iprintf("%d ",rec_buf[i]);
return 0;
}
wait "输入一个字符串:" to a
?asc(a)
#include "stdio.h"
main(){
void ascii(char *p);
char a[20];
gets(a);
char *p;
p=a;
ascii(p);
}
void ascii(char *p){
while(*p!='\0'){
printf("%c ascii is %d\n",*p,*p++);
}
}