Prev Next

Database / cpp

Could not find what you were looking for? send us the question and we would be happy to answer your question.

1. What is endl in cpp?

endl defined in std namespace (std::endl), inserts a newline character into the output sequence and flushes it.

2. Difference between header file (.h) and cpp file (.cpp).

Header files (.h) provide information that will be required in multiple files or in a module. Class declarations, function prototypes and enumerations typically go in header files.

void print_factorial(int n);
int factorial(int n);

Code files (.cpp) contains the implementation that only needs to be known in one file. Function bodies and internal variables are implmented in .cpp files.


Comments & Discussions