In this code i want to be able to input rusty knife or any other name i wish into the WeaponName variable and have it print out on the screen. I also do not want the person using the program to be able to change the name of their weapon and was wondering how i would go about doing this.
1 2 3 4 5 6 7 8 9 10 11 12
#include <cstdlib>
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
string WeaponName;
cout << "You find a rusty knife on the ground and pick it up." << endl;
cout << "You now have a " << WeaponName << "equipped" << endl;
}