#include <iostream>
#include <string>
#include <vector>
enum Error_Code
{
success,
not_present,
overflow,
underflow,
duplicate_error
};//class Vertex definition
class Vertex
{
public:
Vertex():x(0), y(0)
{} Vertex(const string &name, int cx = 0, int cy = 0):m_szName(name), x(cx), y(cy)
{} string m_szName; //Vertex's name
int x; //Vertex's coordinate
int y;
};
报错为:
e:\mydocument\c\datastruct\graph\graph.h(24) : error C2629: unexpected 'class Vertex ('
e:\mydocument\c\datastruct\graph\graph.h(24) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
e:\mydocument\c\datastruct\graph\graph.h(26) : error C2146: syntax error : missing ';' before identifier 'm_szName'
e:\mydocument\c\datastruct\graph\graph.h(26) : error C2501: 'string' : missing storage-class or type specifiers
e:\mydocument\c\datastruct\graph\graph.h(26) : error C2501: 'm_szName' : missing storage-class or type specifiers
#include <string>
#include <vector>
enum Error_Code
{
success,
not_present,
overflow,
underflow,
duplicate_error
};//class Vertex definition
class Vertex
{
public:
Vertex():x(0), y(0)
{} Vertex(const string &name, int cx = 0, int cy = 0):m_szName(name), x(cx), y(cy)
{} string m_szName; //Vertex's name
int x; //Vertex's coordinate
int y;
};
报错为:
e:\mydocument\c\datastruct\graph\graph.h(24) : error C2629: unexpected 'class Vertex ('
e:\mydocument\c\datastruct\graph\graph.h(24) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
e:\mydocument\c\datastruct\graph\graph.h(26) : error C2146: syntax error : missing ';' before identifier 'm_szName'
e:\mydocument\c\datastruct\graph\graph.h(26) : error C2501: 'string' : missing storage-class or type specifiers
e:\mydocument\c\datastruct\graph\graph.h(26) : error C2501: 'm_szName' : missing storage-class or type specifiers
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货