开发者

expected specifier-qualifier-list before std

开发者 https://www.devze.com 2023-02-16 16:57 出处:网络
typedef struct _stResult { std::string x; int y; struct _st开发者_开发技巧Result *next; } strResult;
typedef struct _stResult {
  std::string x;  
  int y;
  struct _st开发者_开发技巧Result *next;  
} strResult;

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


Did you forget to #include <string> ?

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号