It's UWAweek 42 (2nd semester, week 12)

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying the 4 articles in this topic
Showing 4 of 738 articles.
Currently 182 other people reading this forum.


 UWA week 37 (2nd semester, week 7) ↓
SVG not supported

Login to reply

👍?
helpful
10:52pm Tue 10th Sep, ANONYMOUS

If they don't have a return value, is their default return value 0.0, or should it be a void function instead?


SVG not supported

Login to reply

👍?
helpful
8:19pm Wed 11th Sep, Joshua N.

ANONYMOUS wrote:
> If they don't have a return value, is their default return value 0.0, or should it be a void function instead?
I think either is fine, but returning 0.0 is probably easier.


SVG not supported

Login to reply

👍?
helpful
11:27pm Wed 11th Sep, ANONYMOUS

Hi, currently I have all the functions double in the translated c file and it works fine even if the function doesn't have a return statement. I read that the return value is undefined for such functions in c so I just wanted to confirm that the return value of a function with no return statement won't be used in an expression in the ml file or do I need to check for that and throw an error in such a case?


SVG not supported

Login to reply

👍?
helpful
9:10pm Thu 12th Sep, Joshua N.

ANONYMOUS wrote:
> Hi, currently I have all the functions double in the translated c file and it works fine even if the function doesn't have a return statement. > > I read that the return value is undefined for such functions in c so I just wanted to confirm that the return value of a function with no return statement won't be used in an expression in the ml file or do I need to check for that and throw an error in such a case?
Just add return 0.0 to the end of your functions if they don't have a return statement.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy