问题1:你是把变量传给了函数,还是把地址传给了函数?
例:
#include
#include
#include
void
oxx(char* dest)
{
dest = (char*)malloc(30);
strcpy(dest, "content has been modied");
}
void
oxx2(char* dest)
{
strcpy(dest, "content hat been modied");
}
int
main()
{
char* dest;
char str[30];
dest = &str[0];