| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 369 人关注过本帖
标题:[求助]帮助找一下错误,谢谢
只看楼主 加入收藏
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
快速回复:[求助]帮助找一下错误,谢谢
数据加载中...
 
   



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

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