hi, here i am a dought that i found a C++ Project in which they included "constants. hh" i want to include the "constants. hh" file in C, can i directly include the header file or any modifications i hav to do. pls suggest m a idea. if possible to use directly or any conversions give me details.
Using C++ header files in C application
Collapse
X
-
Tags: None
-
Ehmmmm, shouldn't the headers of c++ be like "header.h"? And I think that you will have to do a lot of modifications in that header to include it to your c program since C++ is more advanced than C, in other words C++ can compile C files, but it may not work in vice versa.Originally posted by chinnapandu2004hi, here i am a dought that i found a C++ Project in which they included "constants. hh" i want to include the "constants. hh" file in C, can i directly include the header file or any modifications i hav to do. pls suggest m a idea. if possible to use directly or any conversions give me details. -
That is only convention, C / C++ are not fussy and will normally include any old file you care to name. Perhaps the project the file came from uses .hh to denote a header file with a specific type of contents. I know I often use .cxx and .hxx when creating template classes.Originally posted by stealwingsEhmmmm, shouldn't the headers of c++ be like "header.h"?
Not quite true, it is possible to construct C that is not compilable with C++ and without using any really obscure constructions too. For instance the difference in the way they handle void * can be a stumbling block.Originally posted by stealwings... C++ can compile C files ...
Correctly "C++ can compile most C files with little or no modification"Comment
-
Comment