I was just thinking that why I need headers at all? In headers, most oftenly we have the declarations only. In .cpp we have the definitons of that .h file. But, why can't we write all the functions directly in .h file and include it in my project files? Why are we dividing the functions declarations and functions definitions? In header file, we have header guard which prevent to have the definitions again and again. So, there is no point to say that translation unit size would be increased. So, what is the exact reason? Please clarify. Thanks.
Edited 2 Years Ago by nitin1