It's UWAweek 50

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 selected article
Showing 1 of 835 articles.
Currently 11 other people reading this forum.


 UWA week 34 (2nd semester, week 5) ↓
SVG not supported

Login to reply

👍?
helpful
6:06am Mon 19th Aug, Christopher M.

"Manas Rawat" <24*0*7*9@s*u*e*t*u*a*e*u*a*> wrote:
> #define N 10; being wrongly initialised, I think all of the above should be the correct answer, as it makes N = 10, resulting in the error in other statements as well.
The #define preprocessor directive, when used as #define pattern1 pattern2, results in all later instances of pattern1 being replaced by pattern2. In this example, N is not a variable, and is not being initialised, but every following use of N is replaced by 10;. You can follow this example by hand, as under test conditions, to find when the pattern 10; now introduces a syntax error in the C code. And because you're not under test conditions, and have access to a compiler, you could have the compiler identify invalid lines. Hope this helps,

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