windows – What are *.h files for?


I'm starting to learn Visual C++ (2010), I used to use Pascal, so:

  1. I don't quite understand what header files are for;
  2. what exactly is written in them (should be written).


If constants, function prototypes, macros, structure declarations, and similar information is used (is common) in several files with program code, then it is placed in a .h file, which is included in .c files (or other .h) by the #include preprocessor directive . That. shared data is not duplicated. They change in one place and these changes are consistently included in the program codes.

Scroll to Top