posted 19 years ago
Hi,
I hv analyzed the given program in this way,
assert false;
statement will be executed if assertions are enabled during the runtime. If assertions are disabled during the run time , assert statements are just like commented statements. During the compilation compiler doesn't know whether the user executes the program with assertions enabled/disabled, so it is checking only syntax of assert statement.
But any statement after while(true){ } is not reachable , because there is no 'break' statement with in the infinite loop. [ I hv added break statment in the while loop, then no compilation error ] thats why no compilation error at line14.
Please correct me if i am wrong.