循环输出指针的字符串

#include "stdio.h"
void mytest(const char *str);

main()
{
mytest("Hello, Welcome to you.");
return 0;
}

void mytest(const char *str)
{
while(*str)
{
if(str == "")
{
printf("%c", "");
}
else
{
printf("%c", *str);
}
str++;
}
printf("\n");
}

posted @ 2011-10-23 21:33  冒牌工程师  阅读(310)  评论(0编辑  收藏  举报