#include "stdafx.h"
#include<conio.h>
int _tmain(int argc, _TCHAR* argv[])
{
char *pstr="nice to meet you!";
scanf("%s",pstr);
getch();
return 0;
}
你别估计了,原因我已经找出来了.对指针赋值时,要先扩一下指针的内存 在scanf之前使用pstr=(char *)malloc(50);即可 头文件要有malloc.h alloc.h stblib.h 中的一个