Flak Monkey
Gawd
- Joined
- Feb 15, 2005
- Messages
- 651
I just started to try and teach myself c++ a couple of days ago and am currently working on a Tic Tac Toe program.
I'm wondering if there is a way to set up an if statement for a string. When I try something like :
if (loc == aa) {
aa = 1;
}
//Checks if string loc is equal to aa and sets aa = 1 if true
I get an error saying I'm trying to compare a pointer to an integer. I mostly understand why I'm getting this error but I'm wondering if there is a way to compare the text in the string is equal to other text. I hope this is clear, if it isn't respond telling me I'm an idiot and I need to rephrase it.
I'm wondering if there is a way to set up an if statement for a string. When I try something like :
if (loc == aa) {
aa = 1;
}
//Checks if string loc is equal to aa and sets aa = 1 if true
I get an error saying I'm trying to compare a pointer to an integer. I mostly understand why I'm getting this error but I'm wondering if there is a way to compare the text in the string is equal to other text. I hope this is clear, if it isn't respond telling me I'm an idiot and I need to rephrase it.