As a novice C++ programmer I have always put my classes interface in .h
files and implementation in .cpp
files. However I have recently tried C# for a while and I really like its clean syntax and way to organize files, in particular there is no dinstinction between headers and implementation, you usually implement a class for each .cs
file and you don't need headers.
I know that in C++ this is also possible (you can code "inline" functions in .h
files), but up to now I have always seen a clear distinction between .h
and .cpp
files in C++ projects. What are the advantages and disadvantages of this approach?
Thank you