CS2023 Procedural Program Development
C Program Development at UNB
-
Login
-
In ITD415 simply login to one of the workstations
-
From another location, use telnet or ssh (see putty
if you're using a Windows machine):
-
use the following hostname: id415mxx.cs.unb.ca (where xx is between
1 and 40)
-
when prompted, type in your userid and password
-
Emacs
-
Emacs comes with its own C environment. You will be placed in this environment
when you edit a ".c" file.
-
Therefore to begin writing a C program called test.c, run: emacs
test.c
-
After you've finished editing, save the file with ctrl-x, ctrl-s
-
You're welcome to use any other editor (vi, vim, ...)
-
Compiling
-
Use the gcc compiler. For example, to compile (and link) test.c
and create an executable called test, issue the following from
the command line:
-
The -o test option will ensure that your executable is called
test
and not a.out (the default)
-
The -Wall ("all warnings") option does some extra error-checking
-
Running
-
To execute your program called test:
-
"./" is essential. You need to place it in front of any program you
want to run from your own directory (I'll explain this in class)
-
Hardcopy Records
-
You can make a record of an interactive session (i.e., everything you see
on the screen) and store it in a file, which you can print out for an assignment,
using the script command. You will
have to clean up the file a bit, since the file will contain characters
(carriage returns, etc..) which are not normally printed. Alternatively,
you may simply cut and paste your interactive session into an editor.
-
To print a file, use the lpr command.
-
Questions
[CS2023
Home Page][CS
Home Page]
Eric Aubanel, Dec. 23,
2003