Question: Objective: C Tutorial: Pointers, Strings, Exec The purpose of this tutorial is to review C pointers and the use of the exec routines to support
Objective: C Tutorial: Pointers, Strings, Exec
The purpose of this tutorial is to review C pointers and the use of the exec routines to support
programming in C required for the assignments throughout TCSS
Complete this tutorial using your Ubuntu Virtual Machine installed above.
To complete this assignment, submit written answers to questions points for each of ; points
for for screen shot and for explanations as a PDF file to Canvas. MS Word or Google Docs can be
used to easily create a PDF file. Submissions with reasonably answers that demonstrate understanding of
the core content of the tutorial will receive full credit.
Task I: Create a skeleton C program
Start by creating a skeleton C program. Several text editors are available in Linux to support writing C
The Gnome Text Editor, or gedit for short, is a GUI based text editor similar to notepad in Windows.
Popular commandline based text editors, sometimes called TUI editors, include: vim, vi pico, nano, and
emacs.
Optionally, try using an Integrated Development Environment for C under Linux. Search the internet to
find one you like.
To invoke these editors, open a terminal in Linux and type the name of the text editor:
pico exec.c
# pico and nano are similar
vi exec.c
# vim is a variant of vi
gedit exec.c &
# & runs the GUI in the background wo blking the
shell
code exec.c
# for ms vscode
TCSS : Operating Systems Instructor: Juhua Hu
For gedit a GUIbased editor, it is recommended to background the process. Gedit will then run, and
your commandline window will still be available for other work. The & runs a command in the
background keeping the terminal available for use.
For textbased editors, the terminal will be used for the editor.
Now, enter the following code:
Copy & Paste the following code
#include
int mainint argc, char argv
printfhello world
;
printfnumber of argsd
argc;
for int i;i
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
