当前位置: 代码迷 >> C语言 >> 为什么一样的代码写入工程 与写在一个文件里面 编译结果不一样啊
  详细解决方案

为什么一样的代码写入工程 与写在一个文件里面 编译结果不一样啊

热度:155   发布时间:2007-11-02 00:02:42.0
为什么一样的代码写入工程 与写在一个文件里面 编译结果不一样啊
#include <windows.h>
#include <stdio.h>
#include <process.h>
#include <stdio.h>

main ()
{
char *virus_path (char (*p));
char *a=new char [MAX_PATH];
char *b=new char [MAX_PATH];
virus_path(a);
printf (" Main --> %s" ,a);
}
=============================================
#include <windows.h>
#include <stdio.h>
#include <process.h>
#include <stdio.h>
char *virus_path (char (*p))
{
char *c="\\cyc.exe";
GetSystemDirectory(p,25);
strcat(p,c);
printf("virus_path ()-->%s" ,p);
return (p);


==========================================
以上代码为什么下在一个文件下编译没有问题,而 分成2个 写入工程里面,编译就错误啊????
搜索更多相关的解决方案: 工程  文件  编译  代码  结果  

----------------解决方案--------------------------------------------------------
这是因为上面一程序段用到了下面一程序段中的函数.
分成二个,上面一程序段就找不到char *virus_path (char (*p));
而下面一程序段又没有主函数.
----------------解决方案--------------------------------------------------------
同上!
----------------解决方案--------------------------------------------------------
学习了!这块我还是空白呢
----------------解决方案--------------------------------------------------------
  相关解决方案