#include <string> in the header defines some structures. ERROR: string does not determine type

#ifndef STRCUTS_H #define STRCUTS_H #include <string> struct menuEntry { string itemID; //'string' does not name a type string itemName; //'string' does not name a type }; #endif 

I get the same error when I put #include <string> over the header protection. Think about it, I had strange problems placing structure definitions in headers. I must not get it.

+4
source share
1 answer

You need to change string to std::string , i.e.

 #ifndef STRCUTS_H #define STRCUTS_H #include <string> struct menuEntry { std::string itemID; std::string itemName; }; #endif 
+7
source

Source: https://habr.com/ru/post/1338823/


All Articles