c++ - Why make new header files when you can just use C files? -


this question has answer here:

i working sockets , , noted lot of code wrote repeated in different programs , wrote functions of stuff did , saved them in ".c" file without main function. included file in programs wrote using #include . thought of creating header file same figure out how work can't figure out difference make. won't work same way ?

including .c files means compiler has preprocess, parse, , compile code every time - if never changes.

turning common code library header file clients means needs compiled once.

this won't make difference tiny amount of code, it's big deal larger libraries.


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -