ERROR: statement has no effect

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:

1
2
^^11
0
Last edited on
== is different from =.
if both b1 and b2 are true then b_closetag should be true, im comparing and not assigning so I should be using ==... right?
same error even if i try this:
1
2
if (l_content.contains("</") && l_content.contains(">"))
{b_closetag == true;}
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!
Topic archived. No new replies allowed.