need help in string compare
uhh hey guys
i have some problem in string compare. here's a portion of my code.
here's the what i use to store the identifiers
Code:
string a[4];
a[0]="if(i==1||i==x)";
a[1]="else if(j==1||j==x)";
a[2]="else if(j==i)";
a[3]="while(x!=20)";
and here's the execution code
Code:
if(a!=NULL)
//check if array is empty
{
for(int j=0; j<4; j++)
//compare identifiers with tokens
{
if(a[j]== tokens[j])
{cout<<a[j];}
else
{cout<<tokens[j];}
}
see the problem is that when i compile the program the system is hanged for whatever reason that i don't know. i asked a few friends and they say that the problem is with those codes i posted above. can somebody please tell me what's wrong with the codes??