Get a letter from an array of string ?

Hi all,

I have an array of string like

 
string a[10]


When I want to get the second letter of the first string, I tried sth like:

 
a[0][1];


But it doesn't work. There is no error when build but the program cannot run. When I go to the watch mode, it said that: "CXX0058: Error: overloaded operator not found"

So I tried to create a temp string like:

1
2
3
string temp;
temp=a[0];
temp[1];


But the result is still the same. Please help me.

Thanks in advance.
when i do this it just works fine...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <string>

using namespace std;

int main()
{
	string a[10];
	a[0] = "test";

	cout << a[0][0];
	cout << a[0][1];
	cout << a[0][2];
	cout << a[0][3];

	getchar();
	return 0;
}
Thanks, I guess the problem is in other part :-<.
Topic archived. No new replies allowed.