请帮我看看这个程序吧,编译都成功了,还不能运行

请帮我看看这个程序吧,编译都成功了,还不能运行
main()
{
char* greeting="hello ";
char* name;
scanf("%s",name);
strcpy(greeting,name);
printf("%s",greeting);
}

name没有初始化,不能这样使用,必须指向一个确定的空间才可以使用。
修改:

 main()
{
char greeting[40]="hello ";
char name[40];
scanf("%s",name);
strcpy(greeting,name);
printf("%s",greeting);
}

指针是不可以读的,另外缺少头文件,根据你的上下文,我觉得你想用strcat连接字符串

完整的程序

#include <stdio.h>
#include <string.h>

int main()
{
char greeting[100]="hello ";
char name[100];
scanf("%s",name);
strcat(greeting,name);
printf("%s",greeting);
}

编译完成了只代表没有语法错误,但……就像说话一样。没有语法错误,不代表别人能理解你的意思。