C Beginner Help:
- C in MathLab, 200SEO: Find a NeXT Terminal window by double clicking on
the Terminal icon (looks like a display with the word "MACH" repeated on it)
on the left hand side dock.
- If you need help, type
for the UNIX manual help page
for GNU C; press "SPACE" for one "more" page, type "q" to quit the "man" page.
{Remark: do not forget to "RETURN" or "ENTER" for executing each
command.}
- If you want to compile a C program, say "[pgm].c", (the GNU C compiler
is located in "/bin/cc" in MathLab, so the "/bin" directory should be in your
path; here "[name]" notation is used for something the user has to substitute
a user actual name), type on the command line after the prompt:
- If you want to both compile and create a C executable named "[run]"
(instead of the default name "a.out"), type
or if you want to both compile and create a C executable named "[run]"
and want the compile output to go to the file "[pgm.listing]", type
cc -o [run] [pgm].c<[pgm.listing]
- If you want to execute the executable file "[run]" with output and input
at the terminal, type
or if you want to execute the executable file "[run]" with input file called
"[pgm.input]" and with output going into the file "[pgm.output]", type
[run]<[pgm.input]>[pgm.output]
or if you want to run the executable in the background, so you can continue
to use the NeXT Terminal window for checking the status with the UNIX
"jobs" command, type
[run]<[pgm.input]>[pgm.output]&
- If you want to read your output, use your favorite editor, like the UNIX
"vi" visual editor with the command
or the NeXT editor by
finding the "[pgm.output]" in the NeXT file viewer Workspace.
Web Source: http://www.math.uic.edu/~hanson/UNIX/mcs471cpgm.html
Email Comments or Questions to
hanson@math.uic.edu