Waiting for else part execution
-
Today I came across the following code
if (1=1){
doSomeThing();
}
else{
doBestThing();
}I am waiting for the execution of else part :-D
-
Today I came across the following code
if (1=1){
doSomeThing();
}
else{
doBestThing();
}I am waiting for the execution of else part :-D
Madhanlal JM wrote:
if(1=1){
doSomeThing();
}
else{
doBestThing();
}I am waiting for the execution of else part
if (1=1){ doSomeThing(); Goto l; } else{ l: doBestThing(); } Now the else part will run! Am I Correct? :)
-
Madhanlal JM wrote:
if(1=1){
doSomeThing();
}
else{
doBestThing();
}I am waiting for the execution of else part
if (1=1){ doSomeThing(); Goto l; } else{ l: doBestThing(); } Now the else part will run! Am I Correct? :)
-
Madhanlal JM wrote:
if (1=1){
That does not even compile on any braced language i know of. ;P (yeah, i'm just nitpicking)
well, it will compile for C and C++ at least! you young spring chicken! :P
My programming get away... The Blog... DirectX for WinRT/C# since 2013! Taking over the world since 1371!
-
I am not a goto expert(thank God) but i believe you have to define I before the Goto part.
Microsoft ... the only place where VARIANT_TRUE != true
Argonia wrote:
I am not a goto expert(
I can see that.. of course you can go to to a label define after, in C, C++, C# at least!
My programming get away... The Blog... DirectX for WinRT/C# since 2013! Taking over the world since 1371!
-
well, it will compile for C and C++ at least! you young spring chicken! :P
My programming get away... The Blog... DirectX for WinRT/C# since 2013! Taking over the world since 1371!
Are you sure it will compile?
'1'
is not an l-value.The difficult we do right away... ...the impossible takes slightly longer.
-
well, it will compile for C and C++ at least! you young spring chicken! :P
My programming get away... The Blog... DirectX for WinRT/C# since 2013! Taking over the world since 1371!
-
Today I came across the following code
if (1=1){
doSomeThing();
}
else{
doBestThing();
}I am waiting for the execution of else part :-D
-
Today I came across the following code
if (1=1){
doSomeThing();
}
else{
doBestThing();
}I am waiting for the execution of else part :-D
-
Madhanlal JM wrote:
if (1=1){
That does not even compile on any braced language i know of. ;P (yeah, i'm just nitpicking)
I'm digging deep into the past, but I believe that with MS QuickC, it may have allowed the compile. Upon execution, memory offset 1 would be overwritten with 1. Possibly an immediate crash, or more likely, a crash waiting to happen. I know it'd work with a cast to a pointer. QuickC was rather forgiving at times. Some of those times it was to my regret.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"As far as we know, our computer has never had an undetected error." - Weisert
"If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010
-
I wont, you can't assign to an rvalue. UNLESS 1 is actually a macro that expands to something that makes sense on that context, but I don't even know if a macro can be called 1.
You cannot write a macro beginning with an digit.
"If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.