This is based on GCC/G++ and usually on Ubuntu.
Here's my sample program I've done:
#include <iostream>
using namespace std;
int main()
{
std::string c = "Test";
cout << c;
return 0;
}
The above code works fine.
But I have two issues that I don't quite get...
Writing the string declaration as
std:string(with one:) also works fine. What's the difference?If I use
std:string(with one:) within a class to declare a private variable, I get an error error: ‘std’ does not name a type. Example of this declaration:
class KType
{
private:
std:string N;
};
Can someone please explain these issues? Many thanks!