Loading and Running C software
on machines in TigerLAN Lab ET236
_______________________________________________________________________________________________
The following steps demonstrate how to log
on, create and execute an example C program using the VAX
software editor.
Step 1: Log on to your tigerLAN account as per instructions below
-
Press Ctrl Alt Del keys simultaneously
-
Enter user name and password
-
Double click on the Terminal icon
-
Select option 7 (i.e, exit to $ prompt). The VAX command line prompt (i.e,
$) will appear.
Step 2 : Log on to your VAX acccount as per instructions below
-
Select the File pull down menu
-
Click on Open
-
Select MSUVX2
-
Click on OK
-
Enter user name and password
Step 3 : Create a example C program file using the VAX editor as
per instructions below
-
At the $ command line prompt type the following
ed example1.c
Step 4: Writing the C program.
Note the following about C programs :
-
All executable C program file names end with extension .c
-
Within the program file all comments begin with /* and end with */ ie
all text between /* and */ will not be executed .
-
type in the following lines ie the program
/* File name: example1.c */
/* sample C program to print out a name */
#include <stdio.h>
/* necessary so that input output statements can be used*/
main()
/* necessary :every C program begins executing after main */
{
/* necessary: starts the main block */
char name[50];
printf("\n\n------------------------------------\n");
printf("Enter your name :");
gets(name);
printf("Your name is %s", name);
}
/* necessary : ends the main block */
Step 5: Save the program
-
To save the contents of the press the Ctrl and the Z. key simultaneously.
This causes the VAX editor to save the program and display a line similar
to the line below.
23 lines written to file Q820I:[YOUR USER NAME]EXAMPLE1.C;1
Step 6: Compile the program
-
At the $ prompt type in the following
cc example1.c
Step 7 : Link Sthe program
-
At the $ prompt type in the following
link example1
Step 8: Execute the program
-
At the $ prompt type in the following
run example1
To Tutorial Index