string question

what's wrong with this string?:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  #include <iostream>
#include <cstdlib>

using namespace std;

string my_string;

int main()
{
	int k;

	//to enter brahman:
	int s;

	int x;
	int y;
	int z;
	int a;
	int b;
	int c;
	int d;

	//introduction
	cout << " \n";
	cout << "#####   #####   ##### \n";
	cout << "#   #   #   #   #     \n";
	cout << "#####   #   #   ##### \n";
	cout << "#       #   #   #     \n";
	cout << "#       #####   ##### \n";
	cout << " \n";

	cout << "Hello. Welcome to Planets of Evolution!\n";


repeat:

	cout << "enter your player name: ";
	cin >> my_string;
	cout << " \n";


something's up with it. visual studio is bugging it but when i ran it in linux it was working fine. how come i can't build?

try adding #include <string> ?

It seems to run OK from the button at the top right of the code (just needed to add a closing } at the end).
Last edited on
yep! #include <string> did the trick!

thanks for the help!
Topic archived. No new replies allowed.