473,395 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

difference in header files

what's the difference between a .h and a .hpp file
Also please tell me something about .rh files
--
Pradyut
http://pradyut.tk
http://groups.yahoo.com/group/d_dom/
http://groups-beta.google.com/group/oop_programming
India
Nov 15 '05 #1
11 1729
In article <42***********************@authen.white.readfreene ws.net>,
Pradyut <pr******@gmail.com> wrote:
what's the difference between a .h and a .hpp file
C doesn't promise that a .hpp file can be #include'd -- unique
mappings are promised only for (up to) 6-characters followed by a
single character.
Also please tell me something about .rh files


As per above, C doesn't promise that .rh files are usable either.
Perhaps you are thinking of some other programming language, such
as C++?
--
Ceci, ce n'est pas une idée.
Nov 15 '05 #2
Pieknego dnia Wed, 10 Aug 2005 01:22:17 +0530,
osobnik Pradyut napisa³(a):
what's the difference between a .h and a .hpp file

..hpp are header files for c++, while h for c

--
\x6b\x75\x6c\x6b\x61
Nov 15 '05 #3
Pradyut wrote:
what's the difference between a *.h and a *.hpp file
These file extensions are arbitrary but customary.
You can include files with *any* file name extension or none at all.
Also please tell me something about .rh files


Which is what appears to have been done here.

The *.h extension was added to [UNIX] file names
to suggest that the file was a C *header* file
instead of a C *source* file.
The *.hpp file name extension is sometimes used
to distinguish C++ header files from C header files.

A header file is a file that is included near the top (head)
of a translation unit (source file) or another header file.
It may contain *any* valid C code
but header files are commonly used
to introduce a module interface into a translation unit.
The module interface contains C preprocessor macro definitions,
type definitions, constant definitions,
function and variable declarations
that do not by themselves require the compiler to emit code
or reserve space for objects.
Nov 15 '05 #4
On Wed, 10 Aug 2005 01:22:17 +0530, in comp.lang.c , "Pradyut"
<pr******@gmail.com> wrote:
what's the difference between a .h and a .hpp file
this would be something specific to your implementation or company
style. C doesn't place any particular requirements on the file
extensions - remember that its only MSDOS and its children that think
the extension is an indication of the file's format, most other OSen
find it more useful to store that info elsewhere...

<ot>
some people like to use hpp for C++ includes and h for C ones.
</ot>
Also please tell me something about .rh files


Something else system-specific. Possibly resource includes? Ask in a
newsgroup specialising in your compiler.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 15 '05 #5
In article <dd**********@nntp1.jpl.nasa.gov>,
E. Robert Tisdale <E.**************@jpl.nasa.gov> wrote:
These file extensions are arbitrary but customary.
You can include files with *any* file name extension or none at all.


C89 doesn't promise that it will be able to uniquely locate files
whose extension is more than 1 character long. (C89 doesn't want to
impose any filesystem semantics onto freestanding implementations.)
--
This signature intentionally left... Oh, darn!
Nov 15 '05 #6
Walter Roberson wrote:
In article <dd**********@nntp1.jpl.nasa.gov>,
E. Robert Tisdale <E.**************@jpl.nasa.gov> wrote:
These file extensions are arbitrary but customary.
You can include files with *any* file name extension or none at all.


C89 doesn't promise that it will be able to uniquely locate files
whose extension is more than 1 character long.


Yup, the same stands for C99 as well. Not only that, the 1 character
must be a *letter* to qualify for this this guarantee. Additionally,
since the implementation may ignore the case of filenames in #include
directives, it need not differentiate between header.h and header.H (or
HEADER.H for that matter).

Robert Gamble

Nov 15 '05 #7
On Tue, 9 Aug 2005 19:58:39 +0000 (UTC), ro******@ibd.nrc-cnrc.gc.ca
(Walter Roberson) wrote in comp.lang.c:
In article <42***********************@authen.white.readfreene ws.net>,
Pradyut <pr******@gmail.com> wrote:
what's the difference between a .h and a .hpp file


C doesn't promise that a .hpp file can be #include'd -- unique
mappings are promised only for (up to) 6-characters followed by a
single character.


Note that this is, and has been since 1999:

"The implementation shall provide unique mappings for sequences
consisting of one or more letters or digits (as defined in 5.2.1)
followed by a period (.) and a single letter. The first character
shall be a letter. The implementation may ignore the distinctions of
alphabetical case and restrict the mapping to eight significant
characters before the period."

So it now 8 characters, and the standard now includes three standard
headers that have more than six significant characters before the
period: <complex.h>, <stdbool.h>, and <inttypes.h>

Other than the standard headers, C places no restrictions at all on
the contents of <h_char_sequence> or "q_char_sequence" in a #include
directive. If between them the implementation and underlying platform
map them into a file "that can be processed by the application", it
causes the replacement of the directive by the entire contents of the
file.

If the sequence does not match a standard header and does not map to
the name of a file that can be processed by the application, it is a
constraint error and a diagnostic is required.
Also please tell me something about .rh files


As per above, C doesn't promise that .rh files are usable either.
Perhaps you are thinking of some other programming language, such
as C++?


I don't really see what C++ has to do with it.

Even under MS-DOS, in fact even under CP/M 80, I could expect:

#include "filename.rh"

....to do what I wanted, assuming there was a file named filename.rh in
the implementation-defined search path. Although AFAIK there was
never a C90 conforming implementation for CP/M 80.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 15 '05 #8
On Tue, 9 Aug 2005 21:59:32 +0000 (UTC), ro******@ibd.nrc-cnrc.gc.ca
(Walter Roberson) wrote in comp.lang.c:
In article <dd**********@nntp1.jpl.nasa.gov>,
E. Robert Tisdale <E.**************@jpl.nasa.gov> wrote:
These file extensions are arbitrary but customary.
You can include files with *any* file name extension or none at all.


C89 doesn't promise that it will be able to uniquely locate files
whose extension is more than 1 character long. (C89 doesn't want to
impose any filesystem semantics onto freestanding implementations.)


Where does C89, or any other version, mention an implementation that
runs (as opposed to builds code for) a free-standing environment?

No environment for translators is mentioned at all. The distinction
between hosted and free-standing environments has to do with
execution, not translation.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 15 '05 #9
On Tue, 09 Aug 2005 21:47:33 -0500, Jack Klein wrote:
On Tue, 9 Aug 2005 21:59:32 +0000 (UTC), ro******@ibd.nrc-cnrc.gc.ca
(Walter Roberson) wrote in comp.lang.c:
In article <dd**********@nntp1.jpl.nasa.gov>,
E. Robert Tisdale <E.**************@jpl.nasa.gov> wrote:
>These file extensions are arbitrary but customary.
>You can include files with *any* file name extension or none at all.


C89 doesn't promise that it will be able to uniquely locate files
whose extension is more than 1 character long. (C89 doesn't want to
impose any filesystem semantics onto freestanding implementations.)


Where does C89, or any other version, mention an implementation that
runs (as opposed to builds code for) a free-standing environment?

No environment for translators is mentioned at all. The distinction
between hosted and free-standing environments has to do with
execution, not translation.


The standard sepcifies hosted and freestanding implementations as well as
execution environments. This is highly relevant to translation, for
example #include <stdio.h> may legitimately fail during translation on a
freestanding implementation.

Lawrence

Nov 15 '05 #10
<posted & mailed>

A ".h file" is a file using a common convention for naming header files for
C libraries. As far as the C language is concerned, there's no such thing
as a .hpp or .rh file.

Pradyut wrote:
what's the difference between a .h and a .hpp file
Also please tell me something about .rh files


--
Remove '.nospam' from e-mail address to reply by e-mail
Nov 15 '05 #11
On Tue, 09 Aug 2005 22:57:46 +0100, Mark McIntyre
<ma**********@spamcop.net> wrote:
On Wed, 10 Aug 2005 01:22:17 +0530, in comp.lang.c , "Pradyut"
<pr******@gmail.com> wrote:
what's the difference between a .h and a .hpp file


this would be something specific to your implementation or company
style. C doesn't place any particular requirements on the file
extensions - remember that its only MSDOS and its children that think
the extension is an indication of the file's format, most other OSen
find it more useful to store that info elsewhere...

I know no OS that itself relies on the extension, except in a CI/shell
that can be overridden or at least adjusted to some extent. But there
certainly have been many before and other than MS that supported an
extension or equivalent field that most or all vendor-supplied utility
software _did_ rely on: at least RT-11, RSX-11, TOPS-10 and -20 -- and
(nonvendor) ITS to some extent, VMS, I think AOS/VS, and VM/CMS. And
CP/M, which is no child of MSDOS although a case can be made for the
inverse. Even in Unix _some_ utility software relies on extensions.

- David.Thompson1 at worldnet.att.net
Nov 15 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: matthurne | last post by:
I just started learning C++ on my own...I'm using Accelerated C++. Something it hasn't explained and I keep wondering about is how header files actually work. I suspect it doesn't get into it...
4
by: s.subbarayan | last post by:
Dear all, How different is a header file from a library file in C?Under what circumstance u go for library and under what circumstance u go for header?Afaik,both have some declarations which can...
18
by: John Smith | last post by:
Hi all What does the group think of the practise of including one header file from inside another? I have some legacy code where this has been done, and it creates a dependency on a module...
8
by: nrhayyal | last post by:
Hi c++ Gurus, Need your blessing. while testing few aspects with respect to header file inclusions, i observed few things which i would like to share with you. i have a file sqlca.h in which a...
3
by: artifact.one | last post by:
Hi. What's the practical difference between: #include <header.h> and: #include "header.h"
2
by: david wolf | last post by:
My understanding is that cstdio basically is the same as stdio.h except the functions are in a namspace called std. However when I take a look at the content of the file cstdio, it has the...
34
by: Mark Sullivan | last post by:
What is the difference between the extensions *.hxx and just *.h for header files ? Can they co-exist? Mark
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.