NOTE: Make sure you read through the power-points in the Unix/Linux module of the Content section.
If you are not currently in your CS100 folder, navigate to that folder.
Make a new directory called: Homework1 (remember to use the mkdir command)
Use vi or emacs to create a new code file named hello.c
Either of these commands will work (please review the Unix/Linux module power point on using vi and emacs)
Type in this code:
This is your basic Hello World program for C
If you are using emacs, save the file by using the command CTL-C CTL-S and exit by using the command: CTL-X CTL-C
if you are using vi, save and exit from navigation mode by using the command :wq (that's colon then wq, then enter)
Now we will compile that file with the command line C compiler: gcc
type in the command:
gcc -g -Wall hello.c -o hello
(hit enter)
Assuming you didn't make any mistakes compilation should be successful
IF you used emacs - do this extra step - type in the command: rm *~ then hit enter. This will delete a file emacs created.
Run the ls command to get a listing of your directory
You should only have two files... What are the two files you have in your directory:
_____ _______