I'll translate it when I get home. It's mostly similar, except that C doesn't pretend to be OOP.
Given that the code posted doesn't even attempt to use objects
*, I struggle to think what you're on about.
I'm out of the loop on C++ but ... Pretty sure you need "int main()" if you're going to return an integer.
In fact, take out the 0 in the return and see if that fixes it.
In C++,
main() has to be defined as returning an
int. Also, if you wanted to define a function that returns nothing, just saying
stuff() would be incorrect. What you'd need is
void stuff(). Also, you should never advise people for their C(++) programs to do anything else than return 0 (or
EXIT_SUCCESS, which is technically better) at the end of their successfully-executed programs.
What would the equivalent code in C look like?
It would use
printf() or
puts() instead of
cout, and
scanf() or
gets() instead of
cin. The code would flow pretty much the same, and Parsifal is just being a massive gays.
* - inb4 Parsifal points out that cin and cout are technically objects.