graph.h头文件

#include<iostream>
#include<list>

在图邻接表表示时,使用的c++ 标准库的list

list<int>* HeadNodes;

 

使用主函数引用#include."graph.h"

时,提示出错

上面显示行 error C2501: 'list' : missing storage-class or type specifiers

 

修改意见: std::list<int>* HeadNodes;

引文头文件一般不用using namespace std, 所以使用就在该语句前面加上。

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐