Why we need .h files because we have classes? ūüėÖ | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula gr√°tis
+ 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 ūü§Ē

12th Aug 2021, 3:53 AM
K S Mirthun
K S Mirthun - avatar
4 Respostas
+ 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.
12th Aug 2021, 4:06 AM
Rellot's screwdriver
Rellot's screwdriver - avatar
+ 1
Headers can contain classes, right?
12th Aug 2021, 5:57 AM
Calvin Thomas
Calvin Thomas - avatar
+ 1
Martin Taylor Thanks a lot for the explanation.
12th Aug 2021, 11:39 AM
Calvin Thomas
Calvin Thomas - avatar
0
Ohh now I am clear bro.
12th Aug 2021, 4:19 AM
K S Mirthun
K S Mirthun - avatar