Bridge Course 5
Bridge Course 5
Bridge Course 5
BRIDGE COURSE
Program number - 09(C++)
SUBMITTED BY:
ROHIT KHATRI (CSE/14/320)
COMPILATION PROCESS
Write your C++ program first. Use a text editor such as vi to create a C++ program called
Complex.cpp , ComplexInput.cpp and Complex.h you need to use syntax as follows:
vi Complex.cpp
vi ComplexInput.cpp
vi Complex.h
To compile C++ program you need to use syntax as follows:
g++ -c Complex.cpp
g++ -c ComplexInput.cpp
Writing Your First C++ Program Under Linux :
To compile C++ program Complex.cpp , ComplexInput.cpp, and create an executable file
called output, enter:
g++ o output Complex.cpp ComplexInput.cpp
To execute program first, enter:
./output
INTERMEDIATE FILES
These are the files which are made during program.
ComplexInput.cpp is the file which contain main() of the program and it includes a
headerfile Complex.h
Complex.cpp is the file which contains the definition of the function declared in the
headerfile Complex.h
Complex.h is the user defined headerfile
output is the executable file which is made after the execution of the command
g++ -o output Complex.o ComplexInput.o
g++ compiler acts as both linker and loader.