Original Post
Hi all, I happened to discover something weird.... I am using VC .NET 2003... My code looks something like the following:
double MyFunction()
{
if( nValue == true )
{
//do something
}
else
{
return nSomeOtherValue;
}
}
This code is wrong i know... I should put the return statement outside the if statement, or have a return in both conditions... but somehow the code compiled... and when i ran it, the code stepped into the if block (assume nValue = true), but afterwards, it traced into the else block..?! Is this some kind of bug with the compiler? or does the compiler force the program to step to the return statement?? thanks very much in advance...