上面的代码在VC6下有警告,warning C4172: returning address of local variable or temporary
When returning the address of a variable, you should return the address of a global variable or a dynamically allocated variable, which will continue to exist after the function ends.
上面的_goolooloo_说的对,使用指针和引用,在函数内部修改外部数据,这里只需修改一个地方就可以了,将数组声明为全局的,这里用new 不好
#include <iostream.h>
#include <string.h>