I am getting a strange error when I am trying to get user input as a string.
I have the correct includes;
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
This is the code, where when executed I get the error;
write("Enter your name");
string name = readString();
write(name);
The above code calls these two functions;
void game::write(std::string message)
{
cout << message << "\n";
}
string game::readString()
{
string userInput = NULL;
std::cin >> userInput;
return userInput;
}
This is the error I get:

I have tried re-building the solution - should I used a char array rather than string as the data container for text in my application??