-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
void function returns false if throws #37
Comments
This was invalid Ć. The method should have been marked with public class CanThrow { public static void WillThrow(int a) throws { if (a<15){throw "a<15";} Console.WriteLine(a); } } I've added the missing error message. C doesn't support exceptions, so they are emulated by magic return values, here Thank you! |
void funtion must not return anything.
|
There were bugs both in your code and
|
public class CanThrow { public static void WillThrow(int a) { if (a<15){throw "a<15";} Console.WriteLine(a); } }
compiles into
void CanThrow_WillThrow(int a) { if (a < 15) { return false; } printf("%d\n", a); }
The text was updated successfully, but these errors were encountered: