Tutorials
First 2 weeks
Please ensure that you have completed the following:
- Unix tutorial
- C exercises
Week 3
Describe (in English) the type of var in each of the following declarations:
(a) char** var[];
(b) int* a, var;
(c) int var(int);
(d) int (*var)(int);
(e) void (*var)();
(f) double *(*var)(double);
(g) void (*var)(void*, int);
(h) int *(*(*var)(int*))(void);
(i) void *(*var)(void *(*)(void*), void*(*)(void*),void*);
(j) int (*(*var[3])())(void (*)());
Week 4
Read the man pages for the commands listed in the
lecture area. Pay particular attention to the options listed on that page. Write shell commands to perform the following tasks.
- Show the first five lines of a file.
- Show lines 30-60 of a file.
- List files in ~uqjfenw1/public/a1
- List files in ~uqjfenw1/public/a1 in reverse order.
- How many lines of code are in your assignment one submission?
- How many different users are running programs on moss?
- How many copies of vim are running on moss?
- Give a list of users running on moss and how many processes each is running (most processes at the top).
- Display a table like this:
file1 has 40 lines.
file2 has 100 lines.
file3 has 10 lines.
For the files in ~uqjfenw1/public/a1