Hello! :)
I'm having a problem while comparing one character from a string with a ... string.
This is a part of a pretty complex loop (or, it's complex for me, since I'm new to C++ and programming), but the case is that I need to compare the value of a given i index of a string to a string. For example:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str = "Arne Kristoffer rules";
for(int x = 0; x != str.length(); x++)
{
if (str[x] == "a")
{
cout << str[x];
}
}
cin.get();
return 0;
}
Well, this is just a silly example program, but I hope you see whats wrong (because I don't...)
Thanks! :)
(PS: If you don't understand my english or if I have done something against the forum rules, please send me a PM, so it won't happen again.)