On Sep 18, 11:33 am, karthikbalaguru <karthikbalagur...@gmail.com>
wrote:
> Hi,
>
> I have never used .hpp for header file. I came across '.hpp' in a
> certain set of code.
> I searched the net, but it has been stated that we can use
> either .h/.hpp for header files.
> Is there any reason behind using '.hpp' ?
> What could be the advantage of using '.hpp' extension over '.h'
> extension ?
>
> Thx,
> Karthik Balaguru
Hi Karthik
The use of differnet extensions for header file and even source file
is dependent to implementation and programming environment. For
example in Visual C++ and .NET environemts the convention is .h for
headers and .cpp for sources. In older versions of UNIX environment,
compilers used .C (capital c) or .CC for sources and .h for headers.
Newer compilers like GCC supports vast extensions
like .h, .hpp, .C, .CXX (it is + with 45 degrees rotation), .C++. I
personally use (.h/.C++).
And finally, I think from point of Standard C++ view, there is no
advantage using one extension over another one.
Regards,
Saeed