






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Lecture 17
Create the program source file.
Compile to produce an object file.
Link with other object files (stored in a
library) to produce an executable file.
it usually would be better to separate them into three files such as square.cpp, cube.cpp, and (optionally) factorial.cpp.
separately to produce square.o, cube.o and factorial.o object files.
ar -d mylib.lib mylib.o and place into it our three new object files: ar -r mylib.lib square.o cube.o factorial.o
// From Deitel & Deitel Chap 5 Section 13
long factorial (long number)
{
if ( number <= 1 ) return 1 ; else return ( number * factorial (number - 1)) ;
} Docsity.com