if( DoSomething() )
goto fail;
else if(DoSomethingElse())
goto fail;
goto fail;
else if(DoSomethingOtherThanElse())
goto fail;
You get a syntax error at the final else-if. A better way would probably be: int err = 0;
if(!err)
err = DoSomething();
if(!err)
err = DoSomethingElse();
if(!err)
err = DoSomethingOtherThanElse();
if(err) goto fail;
I would prefer chainable commands that abstracts out the error checking though. err = Chain(DoSomething).Then(DoSomethingElse).Then(DoSomethingOtherThanElse); input: correcthorsebatterystaple
output: ~~krct^hrs333bttstpl$$:)
input: password
output: lulz!isma:PASSWORD#sorrynotsorry
[1] http://www.census.gov/hhes/www/housing/special-topics/files/...