C指针函数返回问题,编译通过 执行后是乱码
为什么我运行后结果是乱码呢???
Dev—C++上运行的
#include <windows.h>
#include <stdio.h>
char *File(char (*get));
main()
{
char *get_path = new char[MAX_PATH];
memset(get_path,0,MAX_PATH);
File(get_path);
printf("%s\n",get_path );
delete []get_path;
}
char *File(char (*get))
{
DWORD bufCharCount = MAX_PATH + 1;
GetSystemDirectory( get, MAX_PATH + 1 );
char *c = "\\cyc.exe";
strcat(get, c);
return (get);
}
[此贴子已经被作者于2007-10-29 23:41:13编辑过]