I am trying to make a simple little game in c++ for practice purposes. However, I cannot use the string class for reasons I am unable to determine. Here is the relevant code:
#include<iostream>
#include<string>
#include"Gameplay.h"
usingnamespace std;
void Gameplay::NewGame(){
cout << "Welcome to the Potion Game. \n";
cout << "In this game you will gather ingredients to make potions. \n";
cout << "It\'s very simple. \n\n";
cout <<"Before you begin, will you please tell me your name?";
cin >> playerName;
return;
}
When I try to compile the code in Microsoft Visual Basic 2010, I get an error saying that playerName is missing a type identifier. I do not know why it is not recognizing the string class. Could someone please tell me what I am doing wrong here?
(I am sure that there are multiple problems with my code; however, I would sincerely appreciate if I could receive assistance with this problem before moving on to others.)