here is the code i need to ask about.

in header file:

CString Amsg[18];
CString Bmsg[18];

BOOL appeartwice;
BOOL press;

int switch;
int LED;
int i;


in the cpp file:

Amsg[0]="Hello";
Bmsg[0]="Hello";
......
......
Amsg[17]="GoodBye"
Bmsg[17]="GoodBye"

for(i=0; i<18; i++)
{
if(Amsg[i]==Bmsg[i])
{
appeartwice= TRUE;
}
}

if(switch == 1) //Button pressed
{
press=TRUE;
}

if((appeartwice==TRUE)&&(press==TRUE))
{
LED=1; //LED turn on.
}
else if(((appeartwice==FALSE)&&(press==TRUE))||((appeartwice==TRUE)&&(press==FALSE)))
{
LED=0; //LED turn off
}



now the question i want to ask is if this if(Amsg[i]==Bmsg[i]) condition valid for Visual C++ to read it?

or is the way to compare CString array with Cstring array is different?

i build my whole program with no errors detected but when i run it i have error window popped out.