标题:[求助]帮助找一下错误,谢谢
只看楼主
cycchina
Rank: 1
等 级:新手上路
帖 子:52
专家分:0
注 册:2007-8-24
 问题点数:0 回复次数:0 
[求助]帮助找一下错误,谢谢

下面的代码编译后是 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编辑过]

搜索更多相关主题的帖子: compound include before 
2007-10-10 15:58



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-176432-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.361272 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved