comparing two variables

Hucaru (39)
Hi I am trying to convert a char array at a certain point (i) with a string at a certain point (i).

1
2
3
char key2[26] = "abcdefghjklmnopqrstuvwxyz";

if (key2[i] == data.at(i)){}


I have narrowed the problem down to line 3, but cannot find a solution. As far as I am aware string::at returns a char value? So I do not understand why they cannot be compared. Any advice would be appreciated. Thanks.
Athar (4379)
So I do not understand why they cannot be compared.

Who says they cannot be compared?

I have narrowed the problem down to line 3

What problem?
Peter87 (3687)
Do you get an error message? An exception?
Hucaru (39)
Nevermind it just suddenly hit me square in the face after a few hours of pondering. The issue was that it was going going out of memory so never mind I was just being an idiot.
Registered users can post here. Sign in or register to post.