There are numerous problems with your code, but this will compile. No idea if it works, since you don't show the rest of your app:
int nSet =0 ;
int nCount=0 ;
string cPrevtag ="";
if (nCount == 1 && cPrevtag == "O")
{
nSet = nSet + 1;
}
As others have noted, you can't compare a string to a character ( single quotes indicate a character). Also, you have to use == for comparison. Finally, your comment wasn't closed */
Matt