| Christof Meerwald@freec++.prog | ||||
For Statement Condition
int Ac = 0, Ad = 0;
struct A
{
A( bool b )
: b ( b )
{ Ac++; }
operator bool() { return b; }
~A() { Ad++; }
bool b;
};
int main()
{
for (int i = 0; A a = (i < 2); i++)
{
if (Ac != (Ad + 1)) return 1;
if(i >= 2)
{
return 1;
}
}
if (!(Ac == 3 && Ad == 3)) return 1;
int a = 0;
return 0;
}
| ||||
This Web page is licensed under the Creative Commons Attribution - NonCommercial - Share Alike License. Any use is subject to the Privacy Policy.
|
Revision: 1.2, cmeerw.org/prog/freecpp/for_stmt_cond.html Last modified: Mon Sep 03 18:20:50 2018 |
Christof Meerwald <cmeerw@cmeerw.org> XMPP: cmeerw@cmeerw.org |