Hi!
i really don't understand why this piece of code wont work:
1 2 3 4 5 6 7
|
bool b1,b2,b_closetag;
b1 = l_content.contains("</");
b2 = l_content.contains(">");
cout << "^^" << b1 << b2 << endl;
if (b1 == true && b2 == true)
{b_closetag == true;} //this line shows error
cout << b_closetag << endl;
|
and for the o/p it will print:
Last edited on
if both b1 and b2 are true then b_closetag should be true, im comparing and not assigning so I should be using ==... right?
This is an error with the use of the operators =
and ==
.
=
assignment operator
==
'is equal to' comparison operator
In the above code,
b_closetag == true;
should be
b_closetag = true;
oh! so sorry overlooked that..thanks!