Notice: Undefined offset: 6902316 in /var/www/html/qa-external/qa-external-users.php on line 744
Could anyone explain ".h" files to me? (description) - OnlineGDB Q&A
Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Could anyone explain ".h" files to me? (description)

+8 votes
asked Jun 9, 2024 by (6,150 points)
reshown Jun 10, 2024 by Admin
Hello! I have prioritized learning C++ and Java. I have stumbled upon ".h" files and learned that they are associated with c++. What I know about them is they are for storing classes and variables i think.

Could anyone send me a link to a source code to explain it more clearly to me?

Thanks :)

1 Answer

+1 vote
answered Jun 10, 2024 by Peter Minarik (101,340 points)
TL;DR; the purpose of the header files is to store type declarations to prevent unnecessary repetitions (and mistakes).

https://learn.microsoft.com/en-us/cpp/cpp/header-files-cpp
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...