UMBC CMSC 201
Fall '06

CSEE | 201 | 201 F'06 | lectures | news | help

Compiling the pieces

The main program and the implementations are compiled separately and linked together to make the a.out file using these UNIX commands.


linux2[90] % ls
big.c  findstats.c  stats.c  stats.h
linux2[91] % gcc -c -Wall -ansi findstats.c
linux2[92] % gcc -c -Wall -ansi stats.c
linux2[93] % ls
big.c  findstats.c  findstats.o  stats.c  stats.h  stats.o
linux2[94] % gcc findstats.o stats.o
linux2[95] % ls
a.out  big.c  findstats.c  findstats.o  stats.c  stats.h  stats.o
linux2[96] % a.out
Enter first number: 30
Enter second number: 60

The sum of 30 and 60 is: 90
The smaller of 30 and 60 is: 30
The larger of 30 and 60 is: 60
The average of 30 and 60 is: 45.000000
The distance between 30 and 60 is: 30
That's all folks.
linux2[97] % 

Last modified - Thursday, 21-Sep-2006 13:24:35 EDT


CSEE | 201 | 201 F'06 | lectures | news | help