School of Physics, Mathematics, and Computing 
Not logged in (login)

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.

How do I ask a good question?
RSS cloud
Jump to:

lab 1

1 of 1097 articles shown, currently no other people reading this forum.
From: Christopher M.
Date: Thu 5th Aug 2021, 2:53pm


> This helps a lot, but still, a little unclear how to actually open that C file. Are we working in the terminal 
> or in the Docker desktop? where are we supposed to actually change the C code according to the labsheet?

Hi,  I'm a bit confused as to where "you're up to" in the steps of:

If you have a Ubuntu image downloaded and populated with necessary packages - providing the C compiler (essential) and 
your choice of tezt editor (vi/vim recommended if you don't already have a favourite - then you can run a new Linux 
terminal within DockerDesktop, or just through the existing terminal program on your system (my preference, as it saves 
on screen real-estate to use the same terminal program with multiple open tabs).

Then (assuming vi as your editor, and that you have the required C file in your present working directory), you run vi 
and pass the file's name on the command-line:

  prompt>  vi rotate.c

Then you're 'in' vi, and you can issue vi's commands navigate around the file or to edit it (switching backwards and 
forwards between command-mode and insert-mode: )

When you've made all the edits you wish, you simply leave vi with two capital Z's - ZZ
and you'll be returned to the shell prompt, where you can compile the modified file:

  prompt>  cc -o rotate rotate.c

If there's no compilation errors (otherwise, back to editing....) you can run the successfully compiled program with:

  prompt>  ./rotate  yourstring

Does that help?

Related articles

lab 1 (all 12) RSS
├─ original   Wed 4th Aug 2021, 8:55pm, ANONYMOUS
├─ reply 1   Thu 5th Aug 2021, 5:45am, Christopher M.
├─ reply 2   Thu 5th Aug 2021, 10:47am, ANONYMOUS  O.P.
├─ THIS   Thu 5th Aug 2021, 2:53pm, Christopher M.
├─ reply 4   Thu 5th Aug 2021, 8:48pm, Amitava D.
├─ reply 5   Fri 6th Aug 2021, 10:55am, ANONYMOUS  O.P.
├─ reply 6   Fri 6th Aug 2021, 1:15pm, ANONYMOUS
├─ reply 7   Fri 6th Aug 2021, 2:46pm, Christopher M.
├─ reply 8   Fri 6th Aug 2021, 2:48pm, Christopher M.
├─ reply 9   Fri 6th Aug 2021, 11:20pm, Malcolm M.
├─ reply 10   Fri 6th Aug 2021, 11:22pm, Malcolm M.
└─ reply 11   Sat 7th Aug 2021, 6:35am, Christopher M.
This Page

Program written by: [email protected]
Feedback welcome
Last modified:  8:37am Nov 14 2021