Missing something obvious as always...

My code won't run properly. The error says unresolved externals. Any advice?

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 <cstring>

using namespace std;

char again;

void reverse(char*);

int main()
{
	do
	{
		const int SIZE = 80;
		char input[SIZE];

		cout << "Enter a string: " << endl << endl;
		cin.getline(input, SIZE);

		cout << "The string displayed backwards is: ";
		reverse(input);
		cout << endl << endl;
		

		cout << "Do you want to run this program again? Y/N: ";
		cin >> again;

	} while (again == 'y' || again == 'Y');

	return 0;
}

void reverse(char *str)
{
	int last = strlen(str) - 1;

	for (int index = last; index >= 0; index--)
		cout << str[index];
	cout << endl << endl;
}
closed account (Dy7SLyTq)
extern char again
@DTSCode: No, `again´ shouldn't be declared `extern´!

@xsesx: Please report the entire error string.
Topic archived. No new replies allowed.