473,549 Members | 2,615 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1755
In article <42************ ***********@aut hen.white.readf reenews.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\x6 b\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**********@n ntp1.jpl.nasa.g ov>,
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**********@n ntp1.jpl.nasa.g ov>,
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.nr c-cnrc.gc.ca
(Walter Roberson) wrote in comp.lang.c:
In article <42************ ***********@aut hen.white.readf reenews.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_sequenc e> or "q_char_sequenc e" 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.r h"

....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.l earn.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.nr c-cnrc.gc.ca
(Walter Roberson) wrote in comp.lang.c:
In article <dd**********@n ntp1.jpl.nasa.g ov>,
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.l earn.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.nr c-cnrc.gc.ca
(Walter Roberson) wrote in comp.lang.c:
In article <dd**********@n ntp1.jpl.nasa.g ov>,
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

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

Similar topics

16
12509
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 because it is, as the authors love to say, "implementation specific". If that's the case, how does the compiler commonly handle them? I use Linux and...
4
2593
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 be called from a source file.And what should I do if i want to build a library?Is it that jus setting the compiler option to be library makes u to...
18
2724
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 (collection of files) which are not required, except for one header file's contents. I'd say 'No, header files should be included in the C source,...
8
3037
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 structure sqlca is declared. i included this file as a soft link in /usr/include. the soft link is as follows: sqlca.h ->...
3
2135
by: artifact.one | last post by:
Hi. What's the practical difference between: #include <header.h> and: #include "header.h"
2
14554
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 following lines inside only: -------content of cstdio on red hat linux enterprise 3---- #ifndef __CSTDIO__ #define __CSTDIO__ #include <stdio.h> #endif
34
19802
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
7521
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7451
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7959
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7473
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7810
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5369
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1944
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.