473,769 Members | 7,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is a header?

If a header is not necessarily a source file, and the sequences delimited by
< and > in header names aren't necessarily valid source file names, what
exactly is a header?
--
p->m == (*p).m == p[0].m
http://www.kdevelop.org
http://www.suse.com
http://www.mozilla.org
Jul 22 '05 #1
31 2805
"Steven T. Hatton" <su******@setid ava.kushan.aa> wrote in message
news:h-*************** *****@speakeasy .net...
If a header is not necessarily a source file, and the sequences delimited by < and > in header names aren't necessarily valid source file names, what
exactly is a header?


A set of declarations. The actual ultimate source of
these declarations is unspecified. It's typically
a file (often with the same name).

-Mike
Jul 22 '05 #2
Steven T. Hatton wrote:
If a header is not necessarily a source file, and the sequences delimited by
< and > in header names aren't necessarily valid source file names, what
exactly is a header?


From a compiler's perspective they don't exist. The preprocessor
combines source and header files (via #include) into translation units.

It's just a programmer convenience. It makes it easier to refer to
common code between translation units by including all the
interfaces/declarations into both.

Everything else you'll see in there is simply the convention (or coding
standards) that were used to write the program. Like where on the line
you indent or put braces.

-- Pete
Jul 22 '05 #3
"Steven T. Hatton" wrote:

If a header is not necessarily a source file, and the sequences delimited by
< and > in header names aren't necessarily valid source file names, what
exactly is a header?


A header is _necessarily_ a source file that is exclusively distinctly visible
by the preprocessor.
Jul 22 '05 #4
Julie wrote:
"Steven T. Hatton" wrote:

If a header is not necessarily a source file, and the sequences delimited
by < and > in header names aren't necessarily valid source file names,
what exactly is a header?


A header is _necessarily_ a source file that is exclusively distinctly
visible by the preprocessor.

"A header is not necessarily a source file, nor are the sequences delimited
by < and > in header names necessarily valid source file names (16.2)."
ISO/IEC 14882:2003(E)
--
p->m == (*p).m == p[0].m
http://www.kdevelop.org
http://www.suse.com
http://www.mozilla.org
Jul 22 '05 #5
Julie wrote:
"Steven T. Hatton" wrote:
If a header is not necessarily a source file, and the sequences delimited by
< and > in header names aren't necessarily valid source file names, what
exactly is a header?

A header is _necessarily_ a source file that is exclusively distinctly visible
by the preprocessor.


2.8 Header names [lex.header]
header-name:
<h-char-sequence>
"q-char-sequence"
h-char-sequence:
h-char
h-char-sequence h-char
h-char:
any member of the source character set except
new-line and >
q-char-sequence:
q-char
q-char-sequence q-char
q-char:
any member of the source character set except
new-line and "

1 Header name preprocessing tokens shall only appear within a #include
preprocessing directive (_cpp.include_) . The sequences in both forms
of header-names are mapped in an implementation-defined manner to
headers or to external source file names as specified in
_cpp.include_.

16.2 Source file inclusion [cpp.include]

1 A #include directive shall identify a header or source file that can
be processed by the implementation.

2 A preprocessing directive of the form
# include <h-char-sequence> new-line
searches a sequence of implementation-defined places for a header
identified uniquely by the specified sequence between the < and >
delimiters, and causes the replacement of that directive by the entire
contents of the header. How the places are specified or the header
identified is implementation-defined.
I don't see anything here requiring headers to be files. In fact, it
sounds like they went out of their way to make sure that was not implied
(e.g., "header _or_ source file").

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.
Jul 22 '05 #6
"Steven T. Hatton" wrote:

Julie wrote:
"Steven T. Hatton" wrote:

If a header is not necessarily a source file, and the sequences delimited
by < and > in header names aren't necessarily valid source file names,
what exactly is a header?


A header is _necessarily_ a source file that is exclusively distinctly
visible by the preprocessor.

"A header is not necessarily a source file, nor are the sequences delimited
by < and > in header names necessarily valid source file names (16.2)."
ISO/IEC 14882:2003(E)


I would have preferred you posting that with your original post.
Jul 22 '05 #7
Kevin Goodsell wrote:
I don't see anything here requiring headers to be files. In fact, it
sounds like they went out of their way to make sure that was not implied
(e.g., "header _or_ source file").


I have the feeling there is some ancient dark secret surrounding this issue
that none of the oldtimers wants to talk about. I tried to ask about the
history of research into alternatives to the traditional header file on
comp.std.c++, but received no reply.

--
p->m == (*p).m == p[0].m
http://www.kdevelop.org
http://www.suse.com
http://www.mozilla.org
Jul 22 '05 #8
* "Steven T. Hatton" <su******@setid ava.kushan.aa> schriebt:
Kevin Goodsell wrote:
I don't see anything here requiring headers to be files. In fact, it
sounds like they went out of their way to make sure that was not implied
(e.g., "header _or_ source file").

I have the feeling there is some ancient dark secret surrounding this issue
that none of the oldtimers wants to talk about.


No dark secrets.

I tried to ask about the
history of research into alternatives to the traditional header file on
comp.std.c++, but received no reply.


The current wording allows an implementation to implement standard
headers in other and perhaps more efficient ways than using files, like
like having e.g. <string> hardwired into the compiler.

Because of that it also allows non-file-based headers in general.

But as far as I know there are no commonly used implementations taking
advantage of this. In terms of designing the standard it's like the common
error of adding complexity to a class in order to support some imagined
future need which never actually materializes. So perhaps what you think
of as the "oldtimers" in [comp.std.c++] simply were a bit ashamed, or even
simpler, didn't think this important enough to waste time on.

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 22 '05 #9
Alf P. Steinbach wrote:
* "Steven T. Hatton" <su******@setid ava.kushan.aa> schriebt:
Kevin Goodsell wrote:
> I don't see anything here requiring headers to be files. In fact, it
> sounds like they went out of their way to make sure that was not
> implied (e.g., "header _or_ source file").
>


I have the feeling there is some ancient dark secret surrounding this
issue that none of the oldtimers wants to talk about.


No dark secrets.

I tried to ask about the
history of research into alternatives to the traditional header file on
comp.std.c++, but received no reply.


The current wording allows an implementation to implement standard
headers in other and perhaps more efficient ways than using files, like
like having e.g. <string> hardwired into the compiler.

Because of that it also allows non-file-based headers in general.

But as far as I know there are no commonly used implementations taking
advantage of this. In terms of designing the standard it's like the
common error of adding complexity to a class in order to support some
imagined
future need which never actually materializes. So perhaps what you think
of as the "oldtimers" in [comp.std.c++] simply were a bit ashamed, or even
simpler, didn't think this important enough to waste time on.


There's an interesting epigraph at the beginning of chapter 18 in
TC++PL(SE). Form is liberating. - engineers' proverb.
--
p->m == (*p).m == p[0].m
http://www.kdevelop.org
http://www.suse.com
http://www.mozilla.org
Jul 22 '05 #10

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

Similar topics

6
22273
by: Zhang Weiwu | last post by:
Hello. I am working with a php software project, in it (www.egroupware.org) Chinese simplified locate is "zh" while Traditional Chinese "tw". I wish to send correct language attribute in http header, I found "zh" is not standard. I found this line in apache2's default httpd.conf # Simplified Chinese (zh-CN) AddLanguage zh-CN .zh-cn
31
1789
by: Steven T. Hatton | last post by:
If a header is not necessarily a source file, and the sequences delimited by < and > in header names aren't necessarily valid source file names, what exactly is a header? -- p->m == (*p).m == p.m http://www.kdevelop.org http://www.suse.com http://www.mozilla.org
3
1827
by: Peter Oliphant | last post by:
I know that 'stdafx.h' has to do with pre-compiled headers. However, it seem weird that it is a required 'include' in any CPP file, especially since the file itself has no code in it! I know that 'stdafx.h' is a good place to put "include files that are used frequently, but are changed infrequently" . But why does this file HAVE to be included when it contains nothing? Just curious about this. I just include it like always and...
4
3640
by: Kunle Odutola | last post by:
I'm trying to understand where the information in the META.INF directory including MANIFEST.MF etc is to be found for .NET assemblies. Also some projects such as Eclipse's OSGi kernel stores additional info in the MANIFEST.MF file. What would be the .NET equivalent where such info can be stored? Kunle --
82
31154
by: quiberon2 | last post by:
Hi, Sorry if it might be a stupid question but what should returns malloc(0) ? void *ptr = malloc(0); I am running gcc 3.3.5 and a non-null address is returned. ( in the compiler that I am currently implementing, NULL is returned. Is it wrong ?)
6
2262
by: DaTurk | last post by:
Hi, I'm a bit rusty with the wonderful language of c++. I worked with it, maybe 6 or 7 years ago and now I need to knock the dust off. But I was perusing some code when I noticed that this one programmer put the entire class in the header file. I'm not sure what the point to that is. Can someone please enlighten me as to why you would want to do this? And if you do want to, what are the pro's and cons of doing it. Are
8
2146
by: The Cool Giraffe | last post by:
One thing i do know for sure. When one creates a CPP file, one needs to include the H file. Now, having said that, i wonder if there are some general hints, requirements or standard guide lines on what and how to include. Suppose that we have a project consisting of a number of classes and structs. Some of them using the others, some using all of them. What is a good approach when including? --
4
9174
by: andre rodier | last post by:
Hello, I need to display or propose a jpeg image on a web page. When I need to display the image, I use this code : header("Content-Length: $fileSize") ; header("Content-Type: $type") ; header("Content-disposition: inline") ; header("Location: $imageURL"); And when I need to propose the image to save, I use this one :
9
1934
by: xiao | last post by:
It always dumped when I tried to run it... But it compiles OK. What I want to do is to do a test: Read information from a .dat file and then write it to another file. The original DAT file is like this : (very simple..........) 010001010110001101010101010101010101010101 #include<stdio.h>
0
9423
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5309
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3965
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
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.