标题:[求助]怎么用list.h头文件啊
只看楼主
sijin_1984
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2006-5-25
 问题点数:0 回复次数:2 
[求助]怎么用list.h头文件啊

我写了这样一个头文件
#ifndef _filelist_H

#define _filelist_H

#include <iostream.h>

#include <list.h>

class filesetlist: class list;

{

public:

friend ostream & operator << ( ostream &, list &);

int flag;

double qidian_x;

double qidian_y;

double qidian_h;

double zhongdian_x;

double zhongdian_y;

double zhongdian_h;

double yuanxin_x;

double yuanxin_y;

double yuanxin_h;

double yuanxin_r;

double yuanxin_l;

};

#endif;

然后又写了这样的filelist.cpp文件

#include "list.h"

ostream & operator << ( ostream &out, list &li)

{
out<< li.qidian_x<< li.qidian_y<< li.qidian_h<<endl;

out<< li.zhongdian_x<< li.zhongdian_y<< li.zhongdian_h<<endl;

out<< li.yuanxin_x<< li.yuanxin_y<< li.yuanxin_h<< li.yuanxin_r<< li.yuanxin_l<<endl;

return out;
}

可是编译是时提示
error C2146: syntax error : missing ';' before identifier 'Length'
error C2501: 'DWORD' : missing storage-class or type specifiers
error C2501: 'Length' : missing storage-class or type specifiers
error C2146: syntax error : missing ';' before identifier 'GetPrevLink'
error C2433: 'WINAPI' : 'inline' not permitted on data declarations
fatal error C1004: unexpected end of file found

是什么原因啊?

搜索更多相关主题的帖子: 头文件 list double qidian zhongdian 
2006-05-25 21:02
cola588
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-6-29
得分:0 

帮你顶

2006-06-29 05:40
cola588
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-6-29
得分:0 
我今天也碰到了这个问题,弄了一个晚上才找到答案,是加一句话
#include <list>
using namespace std;
2006-06-29 05:55



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




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

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