下面的代码编译后是 20 C:\测试2.cpp a function-definition is not allowed here before '{' token
请帮助找一下错误,谢谢.
#include <windows.h>
#include <stdio.h>
#include <process.h>
#include <stdlib.h>
#define ENV_VAR_STRING_COUNT (sizeof(envVarStrings)/sizeof(TCHAR*))
#define INFO_BUFFER_SIZE 32767
main ()
{
char *path;
void compound(char, char(*get)(char)); /*声明 得到路径的函数 */
/*___________________________________________________________________________________*/
TCHAR infoBuf[INFO_BUFFER_SIZE];
DWORD bufCharCount = INFO_BUFFER_SIZE; /* 得到路径代码 */
*path = GetSystemDirectory( infoBuf, INFO_BUFFER_SIZE );
/*___________________________________________________________________________________*/
}
void compound(char path1, char(*get)(char)) /*合成函数定义*/
{
char *path1;
path1 = (*get)(*path1);
/*_______________________________________________________________________*/
char *destination [100];
char *blank = " ", *file_name = "cyc.exe"/*, *path =" " */;
strcpy (destination, path1);
strcat (destination, blank); /*合成代码 */
strcat (destination, file_name);
/*________________________________________________________________________*/
printf(" %s \n",destination); /*测试输出代码*/
}
[此贴子已经被作者于2007-10-10 16:32:26编辑过]