69,373
社区成员
发帖
与我相关
我的任务
分享
char *message = new char[10];
message = "Not Found";
#include <stdio.h>
#include <string.h>
main( )
{
char a[81],*p=a;
char message[10];
// message="Not Found"; //这行提示有问题
memcpy(message,"Not Found",10);
printf("Please enter a string:");
gets(a);
while(*p!='\0')
{
if(*p=='A')
{
// message="Found";
memcpy(message,"Found",10);
break;
}
p++;
}
puts(message);
getchar();
}