There is a (rare) case where you may need to consider their difference
- exit() terminates the current process, no matter where (from which function) it's called. If exit() is called from main() the whole process terminates.
- re...
Someone sent in this question by email
The main() function may return (to the operating system) by calling the exit() function, simply calling return, or 'dropping off' the bottom curly bracket.
In the last 2 cases, no call to exit() ...
ANONYMOUS wrote
When formatting output with printf() and friends, there really is no difference.
However when scanning parsing input with scanf() and friends, using " i" supports reading in integers in different numeric bases, such as base-10 (decimal...
I've noticed that both d and i have been used in labs and workshop solutions to print information stored in variables with 'int' datatype. I don't understand when to use which one. Is there a difference between them or can they be used interchangea...
Just "Chris".
Glad that you resolved the problem, even if it took such drastic measures.
I can't imagine how why you'd be seeing the error you did without it also appearing in so many other situations.
Hi Professor
Really appreciated your time to try.
just letting you know, I reinstalled xcode and restarted my laptop.
copy the code into a new file change the name.
it's all good now.
really not sure why was that.
Thanks again.
J
This problem has me stumped.
I've tried your code on 2 Apple M2 (Xcode) installations, Ubuntu Linux (gcc), and Redhat Linux (an earlier gcc), and all produced the expected result.
I can't imagine why your installation would produce those weird, large v...
Hi Professor
thanks for checking with me, as I'm a FIFO engineer, i just back to perth tonight.
here's the code for this refresh task. the rest of the tasks are all good, just this first one gave me a funny result.
thank you so much for your support.
...
Just "Chris".
I'm afraid that I can't tell from your description alone.
It's likely to be the use of an incorrect datatype or a formatting error - not sure.
As the exercise is not being assessed, please post your code here.
Hi Sir
Experienced weird result for the lab 1 first task (coin change).
Run the program in my laptop, enter 75 as purchase value in cents.
The result as follow
The change is 25 cents.
1 x 20c.
3414288 x 10c.
1 x 5c.
1873589824 x 2c.
1 x 1c.
which is not what ...
Thanks.
I'd presumed that they'd already done that, if (hopefully) following the instructions here https teaching.csse.uwa.edu.au units CITS2002 labsheets software.php
But maybe....
The package manpages-posix is correctly named and still exists, https...
Hello Sir, When running this command "sudo apt install man-db manpages-posix, everything goes well, but then I get an error saying "Unable to locate package manpages-posix"
While there are no structured lab sessions in Week-1, you may like to start reading some introductory material on using the Linux operating system and the standard C compiler (including the C compiler on your Mac, if that is your chosen platform).
In...