Why we need .h files because we have classes? πŸ˜… | Sololearn: Learn to code for FREE!

+2

Why we need .h files because we have classes? πŸ˜…

Class and header file are doing the same thing, right? So what is the difference between them πŸ€”

8/12/2021 3:53:43 AM

K S Mirthun

5 Answers

New Answer

+10

No, they don't have a similar purpose. Header files are used to store declarations in one location and then import them wherever we need them. Classes are used to create and manage new objects. it is the basic ingredient of OOP.

+1

Headers can contain classes, right?

+1

Martin Taylor Thanks a lot for the explanation.

0

Ohh now I am clear bro.