字符串作为参数

#include <stdio.h>
#include <stdlib.h>
void display(char *str)
{
char temp[4];
int i;
i=0;
while(*(str+i)!='\0')
{
temp[i]=*(str+i);
i++;
}
i=0;
while(temp[i]!='\0')
{
printf("%c",temp[i]);
i++;
}

}
void main(void)
{
display("code");
}

posted on 2017-05-17 20:41  多情剑客无情剑;  阅读(325)  评论(0编辑  收藏  举报

导航