+ 1

How to use string as type in header file in C++

I wanna use string as a type in my class header file, but even with and without the string lib, it shows me: error: 'string' does not name a type How can I use string in the header?

18th Jul 2019, 12:09 AM
João Pedro
João Pedro - avatar
5 Respuestas
+ 5
std::string string_name;
18th Jul 2019, 12:45 AM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
+ 3
#include <string>
18th Jul 2019, 12:14 AM
silentlearner
silentlearner - avatar
0
It doesn't work
18th Jul 2019, 12:15 AM
João Pedro
João Pedro - avatar
0
OOOOHHHHH, it's true 🇮🇳Omkar🕉 ! I forgot that the namespace STD wasn't used as default.
18th Jul 2019, 1:00 AM
João Pedro
João Pedro - avatar
0
#include <cstring>
5th Aug 2020, 7:07 AM
Satyasish Patranabish
Satyasish  Patranabish - avatar