473,769 Members | 2,441 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Header file names

I have a header whose filename contains an embedded newline and I can't
seem to #include it successfully. I've tried

#include "my
file.h"

and

#include "my\nfile.h "

but neither works.

1. How can I achieve this?
2. Does the Standard limit the range of characters that can appear in
source file names? (for example, embedded tabs seem to be fine with an
actual tab character in the #include line)

Dec 2 '06
31 2274
Richard Heathfield wrote:
rb********@mail inator.com said:

<snip>
>I see now - "the Standard" seems to mean "the C99 standard" in
these parts, rather than C90.

It depends who you talk to. IMHO, yes, okay, C99 is the de jure
standard, but C90 remains the de facto standard for the time
being, because hardly any conforming C99 implementations exist.
C99 effectively standardises vapourware.
In addition copies of the C99 standard are readily available, which
does not apply to the C90 standard.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net>
Dec 4 '06 #21
CBFalconer said:
Richard Heathfield wrote:
>rb********@mail inator.com said:

<snip>
>>I see now - "the Standard" seems to mean "the C99 standard" in
these parts, rather than C90.

It depends who you talk to. IMHO, yes, okay, C99 is the de jure
standard, but C90 remains the de facto standard for the time
being, because hardly any conforming C99 implementations exist.
C99 effectively standardises vapourware.

In addition copies of the C99 standard are readily available, which
does not apply to the C90 standard.
True (although you can get a C89 draft easily enough). But there's no great
advantage to having easy accessibility to a standard that hardly anyone has
implemented.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Dec 4 '06 #22
On Mon, 04 Dec 2006 07:48:25 +0000, in comp.lang.c , Richard
Heathfield <rj*@see.sig.in validwrote:
>But there's no great
advantage to having easy accessibility to a standard that hardly anyone has
implemented.
Other, of course, than making sure your code is as future-proof as can
be reasonably expected.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Dec 4 '06 #23
Mark McIntyre said:
On Mon, 04 Dec 2006 07:48:25 +0000, in comp.lang.c , Richard
Heathfield <rj*@see.sig.in validwrote:
>>But there's no great
advantage to having easy accessibility to a standard that hardly anyone
has implemented.

Other, of course, than making sure your code is as future-proof as can
be reasonably expected.
Good spot. Yes, okay, that's true. But *apart* from that, what have the
Romans ever done for us, eh?

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Dec 4 '06 #24
Mark McIntyre wrote:
Richard Heathfield <rj*@see.sig.in validwrote:
>But there's no great advantage to having easy accessibility to a
standard that hardly anyone has implemented.

Other, of course, than making sure your code is as future-proof as
can be reasonably expected.
This is one of the few times I have to agree with Mark over
Richard. :-)

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net>
Dec 4 '06 #25
rb********@mail inator.com wrote:
Eric Sosman wrote:
>>That reference seems to be broken - there's no subsection 6.4.7, and
section 6.4, "constant expressions", doesn't mention headers.
ISO/IEC 9899:1999 "Programmin g Languages -- C"
Section 6 "Language"
Section 6.4 "Lexical elements"
Section 6.4.7 "Header names"
Paragraph 1 (syntax description)

I see now - "the Standard" seems to mean "the C99 standard" in these
parts, rather than C90. Slightly depressing that such a monstrosity has
gained such currency - C90 was a thing of beauty, essentially perfect,
and the idea of polluting something so pure with // comments,
variable-length arrays and all the other junk is not a pleasing one :)
There are some things in C99 whose usefulness eludes me,
but face it: ISO/IEC 9899:1999 (as amended) is the International
Standard. "Be not the first by whom the new is tried, nor yet
the last to lay the old aside."

As for the characters permitted in header names: The rule
is not new, not some kind of C99 invention. You will find the
same rule in Section 3.1.7 of the ANSI C Standard, vintage 1989.

--
Eric Sosman
es*****@acm-dot-org.invalid

Dec 4 '06 #26
Richard Heathfield wrote:
Mark McIntyre said:
>Richard Heathfield <rj*@see.sig.in validwrote:
>>But there's no great advantage to having easy accessibility to
a standard that hardly anyone has implemented.

Other, of course, than making sure your code is as future-proof
as can be reasonably expected.

Good spot. Yes, okay, that's true. But *apart* from that, what
have the Romans ever done for us, eh?
Aren't you guys still using their baths, roads, and walls?

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net>
Dec 4 '06 #27
Eric Sosman wrote:
>
rb********@mail inator.com wrote:
Eric Sosman wrote:
>That reference seems to be broken - there's no subsection 6.4.7, and
section 6.4, "constant expressions", doesn't mention headers.
ISO/IEC 9899:1999 "Programmin g Languages -- C"
Section 6 "Language"
Section 6.4 "Lexical elements"
Section 6.4.7 "Header names"
Paragraph 1 (syntax description)
I see now - "the Standard" seems to mean "the C99 standard" in these
parts, rather than C90. Slightly depressing that such a monstrosity has
gained such currency - C90 was a thing of beauty, essentially perfect,
and the idea of polluting something so pure with // comments,
variable-length arrays and all the other junk is not a pleasing one :)

There are some things in C99 whose usefulness eludes me,
but face it: ISO/IEC 9899:1999 (as amended) is the International
Standard. "Be not the first by whom the new is tried, nor yet
the last to lay the old aside."

As for the characters permitted in header names: The rule
is not new, not some kind of C99 invention. You will find the
same rule in Section 3.1.7 of the ANSI C Standard, vintage 1989.
Header names are in 6.1.7 in my copy of ISO/IEC 9899: 1990.

--
pete
Dec 4 '06 #28
pete <pf*****@mindsp ring.comwrites:
Eric Sosman wrote:
[...]
> As for the characters permitted in header names: The rule
is not new, not some kind of C99 invention. You will find the
same rule in Section 3.1.7 of the ANSI C Standard, vintage 1989.

Header names are in 6.1.7 in my copy of ISO/IEC 9899: 1990.
Yes, one of the few differences between the 1989 ANSi standard and the
1990 ISO standard is that the latter adds some sections (or splits up
some existing sections?) in accordance with ISO rules. I think that
ANSI C89 3.X.Y always corresonds to ISO C90 6.X.Y, and it's probably
the same for 4 vs. 7.

(I don't think I've ever seen a copy of the actual 1989 ANSI C
standard. ANSI adopted the ISO standard shortly after it was issued;
presumably they stopped printing the older version at that time.)

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Dec 4 '06 #29
On Mon, 04 Dec 2006 08:05:26 -0500, in comp.lang.c , CBFalconer
<cb********@yah oo.comwrote:
>Richard Heathfield wrote:
>Mark McIntyre said:
>>Richard Heathfield <rj*@see.sig.in validwrote:

But there's no great advantage to having easy accessibility to
a standard that hardly anyone has implemented.

Other, of course, than making sure your code is as future-proof
as can be reasonably expected.

Good spot. Yes, okay, that's true. But *apart* from that, what
have the Romans ever done for us, eh?

Aren't you guys still using their baths, roads, and walls?
er...

romani eunt domi.?
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Dec 4 '06 #30

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

Similar topics

31
2806
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
16
12549
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 gcc specifically. Basically, I don't understand how a header file being included makes a...
11
2763
by: Steven T. Hatton | last post by:
In the past there have been lengthy discussiions regarding the role of header files in C++. People have been very adamat about header files serving as in interface to the implementation. I do understand the objective. This example may represent an interface in need of a bit of refactoring, but it goes to demonstrate the basic idea as I understand it. http://developer.kde.org/documentation/library/cvs-api/kdevelop/html/ast_8h-source.html...
18
2257
by: Exits Funnel | last post by:
Hello, I'm a little confused about where I should include header files and was wondering whether there was some convention. Imagine I've written a class foo and put the definition in foo.h and the implementation of its member functions in foo.cpp (which obviously #inludes foo.h) and further assume that it depends on a class bar which is defined in bar.h. It seems that there are the following two scenarios:
60
8317
by: Derrick Coetzee | last post by:
It seems like, in every C source file I've ever seen, there has been a very definite include order, as follows: - include system headers - include application headers - include the header associated with this source file For example, in a file hello.c: #include <stdio.h>
5
484
by: cwc5w | last post by:
//x.cpp #include <h1> #include "h2" which directory will C++ first look for when including h1? h2? Thanks!
4
5323
by: none | last post by:
Hi, I am wondering if anyone has some insight into a way to get the names of the functions that are defined in a C header file. What I am trying to do is develop tests for a large amount of C files. i have written a Perl script to traverse the directory tree looking for ..h files. i find them and then comes the hard part. I have found that searching for ";" and then going backwards looking for close and then open parens gets me to the...
16
2089
by: wdh3rd | last post by:
Hi everyone. I'm new to C and I have a few questions: I am making files for permutations and combinations. Files to be made are perm.c, perm.h, combo.c, and combo.h. Since both combinations and permutations use factorial to solve their problems, factorial is supposed to be in both perm.c and combo.c, and declared private. (1) You wouldn't ever put a prototype in a header if that function was
0
9589
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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
9865
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8876
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...
0
6675
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3967
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
2
3567
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.