Troudeloup
asked on
{ENTER}
#include <iostream>
using namespace std;
int main ()
{
string string1 = "{ENTER}";
if ( string1[0] == "{" )
{
// so forth
}
return 0;
}
how do I make it work?
I just need to compare the n th char with a " // some string "
i don't know, is this the way things are done in c++?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
pops
test2.cpp:11: error: ISO C++ forbids comparison between pointer and integer
I need to know what the first character is in the string, so I used a if, but it's not allowed becaus I am comparing different type
thank you for cuing me to rephrase, I thought it was ok.