how would you replace the goto in this bit with an exception
for (int bar =0; bar < 100; ++bar)
{
for(int foo = 0; foo < 100; ++foo)
{
if (foo * bar == 100)
{
goto loopBreak;
}
}
}
loopBreak:
printf("%d", 100);
Sorry, been away and a tad late to the party.
There was a great example in Bjarne Stroustrup's book demonstrating throwing an exception out of a deeply nested loop containing the result and then catching it after.
This was however a toy implementation and isn't recommended at all.
I have no problem using a goto in this way (and I do find myself doing similar). In my opinion, this
isnt misusing C.
An example of a misuse of a goto (In C++) would involve the classic case of jumping to the end of a function and returning an error code rather than use an exception, whereas in C, this is acceptable.
Try writing your own parser for the language...
Try writing a parser in pure C#, you will run into exactly the same issues. It also happens that there are many more parsers available to C++ than there is C#. And those for C# are usually just bindings to a C++ library anyway.
Almost everyone LOVES Java and hates C, C++,
Everyone loves tablets... doesnt mean it is possible to write good software on one. You would use a proper tool like a PC.
(I should stop defending C++, I usually lose too much reputation points ;). When it comes down to it, it is personal choice. I would be very interested in having an official language choice Poll on these forums though! I would like to know how close C# is to C++ in popularity of (Indie?) games developers.