hello sir i am reading polymorphism in c++.polymorphism is two types.
1)compile time polymorphism 2)run time polymorphism.
then what is meant by run time?what is meant by compile time?what modifications are done to source code in compile timeand runtime.?
i have referred some books.but they are not giving ans to above questions.they merely discuss only topics of poly morphism.please give detailed ans to my questions.
Compile-time is the time when your source code is being compiled. Templates are instantiated at compile-time.
Run-time is when the compiled program is executed. Source code is not required at all at run-time.
For example, if you have the following program:
std::cout << "Hello World!\n" ;
This could be compiled once
- the source code is translated into executable code at this time.
Once successfully compiled, the program can be run many
times. Every time it runs, we have 'run-time'.