It's UWAweek 47

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 5 articles in this topic
Showing 5 of 828 articles.
Currently 105 other people reading this forum.


 UWA week 43 (2nd semester, study break) ↓
SVG not supported

Login to reply

👍?
helpful
5:25pm Wed 23rd Oct, ANONYMOUS

For give my poor English, this question really confused me:

You are asked to write a C11 function to locate and print all potential trojan- horse programs found via a user’s “PATH” environment variable. The C11 function should have the prototype: int find potential trojans(char *testpath); If there are 3 executable programs named “ls” and 2 named “cp” that can be found via a “PATH” environment variable, then the function will print the full pathnames of all 5 programs, and return the integer 5 to indicate the number of suspicious programs found.

Does that mean: if there are EXACTLY 3 executable programs named “ls” and 2 named “cp” the function returns 5, all other situations, it returns 0 or something?

OR, if there are 1 lses, and 1 cps, it will return 2 if there are 2 lses, and 1 cps, it will return 3 if there is no lese, no cps, it return 0?


SVG not supported

Login to reply

👍?
helpful
6:08pm Wed 23rd Oct, Joshua N.

ANONYMOUS wrote:

For give my poor English, this question really confused me:

All good, this question isn't worded well.

You are asked to write a C11 function to locate and print all potential trojan- horse programs found via a user’s “PATH” environment variable. The C11 function should have the prototype: int find potential trojans(char *testpath);

This is the program you are meant to make.

If there are 3 executable programs named “ls” and 2 named “cp” that can be found via a “PATH” environment variable, then the function will >print the full pathnames of all 5 programs, and return the integer 5 to indicate the number of suspicious programs found.

This is an example of how your function would work.

OR, if there are 1 lses, and 1 cps, it will return 2 if there are 2 lses, and 1 cps, it will return 3 if there is no lese, no cps, it return 0?

Yes.


SVG not supported

Login to reply

👍?
helpful
6:10pm Wed 23rd Oct, Joshua N.

"Joshua Noble" [email protected] wrote:

This is the program you are meant to make.

I meant to say function not program.


SVG not supported

Login to reply

👍?
helpful
7:05pm Wed 23rd Oct, ANONYMOUS

Thank you very much


SVG not supported

Login to reply

👍?
helpful
12:36pm Fri 25th Oct, ANONYMOUS

will there be any writing code questions?

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