John
Member
- Joined
- Aug 8, 2009
- Messages
- 121
- Reaction score
- 0
- Points
- 16
I'm makinga simple program that will ask the user for two lines. The program will then try to find each of the characters used in the second string from the first string, and where they are used and will then do other stuff.
int main() {
string one;
cin >> one;
string two;
cin >> two;
for ( int i = 0; i < one.size(); ++i)
{
char x;
x = two.at(i);
// This is the line that's wrong and I don't know why it
/ doesn't work.
int findx=static_cast <int> (one.find(x));
}
....
int main() {
string one;
cin >> one;
string two;
cin >> two;
for ( int i = 0; i < one.size(); ++i)
{
char x;
x = two.at(i);
// This is the line that's wrong and I don't know why it
/ doesn't work.
int findx=static_cast <int> (one.find(x));
}
....