SPB
SPB

Reputation: 4218

expected specifier-qualifier-list before std

typedef struct _stResult {
  std::string x;  
  int y;
  struct _stResult *next;  
} strResult;

In this structure i am getting the following error expected specifier-qualifier-list before std. What does this error mean?

Upvotes: 1

Views: 2956

Answers (2)

Oswald
Oswald

Reputation: 31647

std::string is not declared. If you #include <string> at the top, the code compiles.

Upvotes: 3

Kornel Kisielewicz
Kornel Kisielewicz

Reputation: 57555

Did you forget to #include <string> ?

The compiler obviously doesn't recognize std::string as a type.

Upvotes: 5

Related Questions