By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,421 Members | 1,128 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,421 IT Pros & Developers. It's quick & easy.

standard headers

P: n/a
If I
# include "text.h"
, where text.h consists of the following:
# define NOTHING_IMPORTANT
# include <stdio.h>
, am I writing c++? cordially, bfx
Jul 2 '06 #1
Share this Question
Share on Google+
11 Replies


P: n/a
BilfFord X wrote:
If I
# include "text.h"
, where text.h consists of the following:
# define NOTHING_IMPORTANT
# include <stdio.h>
, am I writing c++? cordially, bfx
Yes, you are... I am feverishly looking for a catch in
your question. I don't see it, though. Why did you ask?

Generally speaking, including <stdio.his OK, but in C++
we usually include <cstdioinstead.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jul 2 '06 #2

P: n/a

"Victor Bazarov" <v.********@comAcast.netwrote in message
news:ja******************************@comcast.com. ..
BilfFord X wrote:
>If I
# include "text.h"
, where text.h consists of the following:
# define NOTHING_IMPORTANT
# include <stdio.h>
, am I writing c++? cordially, bfx

Yes, you are... I am feverishly looking for a catch in
your question. I don't see it, though. Why did you ask?

Generally speaking, including <stdio.his OK, but in C++
we usually include <cstdioinstead.
I'm trying to get a handle on what makes a non standard header non standard.
I've been cutting open the header files for my implementation, and they
haven't oozed evil like one would expect. The following is a header file
from jacob navia's lcc:
#ifndef __windows_h__
#define __windows_h__
#ifndef __stdlib_h__
#include <stdlib.h>
#endif
#ifndef __string_h__
#include <string.h>
#endif
#include <win.h>
#endif
/* end header post */
This poor fella gets slapped around on the other end of the hallway because
of non standard headers more than Mike Tyson's girlfriends. In these ten
statements, where lies the offense, in particular, when you and I have no
notion what could be in win.h? cordially, bfx
Jul 3 '06 #3

P: n/a
BilfFord X wrote:
"Victor Bazarov" <v.********@comAcast.netwrote in message
news:ja******************************@comcast.com. ..
>>BilfFord X wrote:
>>>If I
# include "text.h"
, where text.h consists of the following:
# define NOTHING_IMPORTANT
# include <stdio.h>
, am I writing c++? cordially, bfx

Yes, you are... I am feverishly looking for a catch in
your question. I don't see it, though. Why did you ask?

Generally speaking, including <stdio.his OK, but in C++
we usually include <cstdioinstead.

I'm trying to get a handle on what makes a non standard header non standard.
Simple - if you can't find it in the standard, it ain't a standard header.

Thus if you us it, your code isn't portable to other systems.

--
Ian Collins.
Jul 3 '06 #4

P: n/a

"Ian Collins" <ia******@hotmail.comwrote in message
news:4g*************@individual.net...
BilfFord X wrote:
>"Victor Bazarov" <v.********@comAcast.netwrote in message
news:ja******************************@comcast.com ...
>>>BilfFord X wrote:

If I
# include "text.h"
, where text.h consists of the following:
# define NOTHING_IMPORTANT
# include <stdio.h>
, am I writing c++? cordially, bfx

Yes, you are... I am feverishly looking for a catch in
your question. I don't see it, though. Why did you ask?

Generally speaking, including <stdio.his OK, but in C++
we usually include <cstdioinstead.

I'm trying to get a handle on what makes a non standard header non
standard.

Simple - if you can't find it in the standard, it ain't a standard header.

Thus if you us it, your code isn't portable to other systems.
Is my text.h above in the standard? cordially, b
Jul 3 '06 #5

P: n/a
BilfFord X wrote:
"Ian Collins" <ia******@hotmail.comwrote in message
news:4g*************@individual.net...
>>BilfFord X wrote:
>>>"Victor Bazarov" <v.********@comAcast.netwrote in message
news:ja******************************@comcast.c om...
BilfFord X wrote:
>If I
># include "text.h"
>, where text.h consists of the following:
># define NOTHING_IMPORTANT
># include <stdio.h>
>, am I writing c++? cordially, bfx

Yes, you are... I am feverishly looking for a catch in
your question. I don't see it, though. Why did you ask?

Generally speaking, including <stdio.his OK, but in C++
we usually include <cstdioinstead.

I'm trying to get a handle on what makes a non standard header non
standard.

Simple - if you can't find it in the standard, it ain't a standard header.

Thus if you us it, your code isn't portable to other systems.

Is my text.h above in the standard? cordially, b
Of course not, but everything it includes is. Try and apply some common
sense.

--
Ian Collins.
Jul 3 '06 #6

P: n/a

"Ian Collins" <ia******@hotmail.comwrote in message
news:4g*************@individual.net...
BilfFord X wrote:
>"Ian Collins" <ia******@hotmail.comwrote in message
news:4g*************@individual.net...
>>>BilfFord X wrote:

"Victor Bazarov" <v.********@comAcast.netwrote in message
news:ja******************************@comcast. com...
>BilfFord X wrote:
>
>
>>If I
>># include "text.h"
>>, where text.h consists of the following:
>># define NOTHING_IMPORTANT
>># include <stdio.h>
>>, am I writing c++? cordially, bfx
>
>Yes, you are... I am feverishly looking for a catch in
>your question. I don't see it, though. Why did you ask?
>
>Generally speaking, including <stdio.his OK, but in C++
>we usually include <cstdioinstead.

I'm trying to get a handle on what makes a non standard header non
standard.

Simple - if you can't find it in the standard, it ain't a standard
header.

Thus if you us it, your code isn't portable to other systems.

Is my text.h above in the standard? cordially, b
Of course not, but everything it includes is. Try and apply some common
sense.
All right. So you're not going to be able to include a file that ultimately
includes an implemention-specific file such as windows.h , and drag it in
wholesale.

Is this:
#ifndef _WINDOWS_
#define _WINDOWS_
where windows.h craps out as standard? cordially, b
Jul 4 '06 #7

P: n/a
BilfFord X wrote:
"Victor Bazarov" <v.********@comAcast.netwrote in message
news:ja******************************@comcast.com. ..
>BilfFord X wrote:
>>If I
# include "text.h"
, where text.h consists of the following:
# define NOTHING_IMPORTANT
# include <stdio.h>
, am I writing c++? cordially, bfx

Yes, you are... I am feverishly looking for a catch in
your question. I don't see it, though. Why did you ask?

Generally speaking, including <stdio.his OK, but in C++
we usually include <cstdioinstead.
I'm trying to get a handle on what makes a non standard header non
standard.
Your 'text.h' is a non-standard header. It doesn't matter that all
in it is standard C++. If it's not defined by the Standard, it's
not standard. However, when you asked "am I writing c++", the answer
is still "yes". Whatever we write is what we write, and our headers
while non-standard can still be a perfectly fine C++.
I've been cutting open the header files for my
implementation, and they haven't oozed evil like one would expect. The
following is a header file from jacob navia's lcc:
I honestly have no idea what "jacob navia's lcc" is.
#ifndef __windows_h__
#define __windows_h__
#ifndef __stdlib_h__
#include <stdlib.h>
#endif
#ifndef __string_h__
#include <string.h>
#endif
#include <win.h>
#endif
/* end header post */
This poor fella gets slapped around on the other end of the hallway
because of non standard headers more than Mike Tyson's girlfriends.
I don't understand. Why would he get slapped? Does he claim any
standard compliance? Does he claim to provide a C++ implementation?
In these ten statements, where lies the offense, in particular, when
you and I have no notion what could be in win.h? cordially, bfx
Why do you care what's inside *his* headers? If you need to include
them, include them. If you don't, don't. Furthermore, why do you
care what's in the headers that his headers include? Why should you
be aware of what <win.his? What if it's some obscure part of what
he provides to you?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jul 4 '06 #8

P: n/a
BilfFord X wrote:
"Ian Collins" <ia******@hotmail.comwrote in message
news:4g*************@individual.net...
>>BilfFord X wrote:
>>>"Ian Collins" <ia******@hotmail.comwrote in message
news:4g*************@individual.net...
BilfFord X wrote:
>"Victor Bazarov" <v.********@comAcast.netwrote in message
>news:ja******************************@comcast .com...
>
>
>
>>BilfFord X wrote:
>>
>>
>>
>>>If I
>>># include "text.h"
>>>, where text.h consists of the following:
>>># define NOTHING_IMPORTANT
>>># include <stdio.h>
>>>, am I writing c++? cordially, bfx
>>
>>Yes, you are... I am feverishly looking for a catch in
>>your question. I don't see it, though. Why did you ask?
>>
>>Generally speaking, including <stdio.his OK, but in C++
>>we usually include <cstdioinstead.
>
>I'm trying to get a handle on what makes a non standard header non
>standard.

Simple - if you can't find it in the standard, it ain't a standard
header.

Thus if you us it, your code isn't portable to other systems.

Is my text.h above in the standard? cordially, b

Of course not, but everything it includes is. Try and apply some common
sense.

All right. So you're not going to be able to include a file that ultimately
includes an implemention-specific file such as windows.h , and drag it in
wholesale.

Is this:
#ifndef _WINDOWS_
#define _WINDOWS_
where windows.h craps out as standard? cordially, b
You are either a troll or a Muppet.

windows.h is a non-standard header because it isn't a standard header.

--
Ian Collins.
Jul 4 '06 #9

P: n/a

"Victor Bazarov" <v.********@comAcast.netwrote in message
news:c-******************************@comcast.com...
BilfFord X wrote:
>"Victor Bazarov" <v.********@comAcast.netwrote in message
news:ja******************************@comcast.com ...
>>BilfFord X wrote:
If I
# include "text.h"
, where text.h consists of the following:
# define NOTHING_IMPORTANT
# include <stdio.h>
, am I writing c++? cordially, bfx

Yes, you are... I am feverishly looking for a catch in
your question. I don't see it, though. Why did you ask?

Generally speaking, including <stdio.his OK, but in C++
we usually include <cstdioinstead.
I'm trying to get a handle on what makes a non standard header non
standard.

Your 'text.h' is a non-standard header. It doesn't matter that all
in it is standard C++. If it's not defined by the Standard, it's
not standard. However, when you asked "am I writing c++", the answer
is still "yes". Whatever we write is what we write, and our headers
while non-standard can still be a perfectly fine C++.
That's the answer I was looking for. Thank you.
>I've been cutting open the header files for my
implementation, and they haven't oozed evil like one would expect. The
following is a header file from jacob navia's lcc:

I honestly have no idea what "jacob navia's lcc" is.
>#ifndef __windows_h__
#define __windows_h__
#ifndef __stdlib_h__
#include <stdlib.h>
#endif
#ifndef __string_h__
#include <string.h>
#endif
#include <win.h>
#endif
/* end header post */
This poor fella gets slapped around on the other end of the hallway
because of non standard headers more than Mike Tyson's girlfriends.

I don't understand. Why would he get slapped? Does he claim any
standard compliance? Does he claim to provide a C++ implementation?
I don't understand either. He's on the receiving end of a lot of abuse over
this. Whether it's deserved is not something I can judge.
>In these ten statements, where lies the offense, in particular, when
you and I have no notion what could be in win.h? cordially, bfx

Why do you care what's inside *his* headers? If you need to include
them, include them. If you don't, don't. Furthermore, why do you
care what's in the headers that his headers include? Why should you
be aware of what <win.his? What if it's some obscure part of what
he provides to you?
It seems odd to me that the solution to the problem of non-standard headers
would seem to be to paste them into the implementation. Happy Fourth. bfx
Jul 4 '06 #10

P: n/a
BilfFord X wrote:
Is this:
#ifndef _WINDOWS_
#define _WINDOWS_
where windows.h craps out as standard? cordially, b
_WINDOWS_ is in the implementation namespace, so if you
define it yourself then you might break a standard header.

Your defines should not start with _ followed by a capital letter,
nor contain a double underscore anywhere.

Jul 5 '06 #11

P: n/a

"Ian Collins" <ia******@hotmail.comwrote in message
news:4g*************@individual.net...
BilfFord X wrote:
>"Ian Collins" <ia******@hotmail.comwrote in message
news:4g*************@individual.net...
>>>BilfFord X wrote:

"Ian Collins" <ia******@hotmail.comwrote in message
news:4g*************@individual.net...
>BilfFord X wrote:
>
>
>>"Victor Bazarov" <v.********@comAcast.netwrote in message
>>news:ja******************************@comcas t.com...
>>
>>
>>
>>>BilfFord X wrote:
>>>
>>>
>>>
>>>>If I
>>>># include "text.h"
>>>>, where text.h consists of the following:
>>>># define NOTHING_IMPORTANT
>>>># include <stdio.h>
>>>>, am I writing c++? cordially, bfx
>>>
>>>Yes, you are... I am feverishly looking for a catch in
>>>your question. I don't see it, though. Why did you ask?
>>>
>>>Generally speaking, including <stdio.his OK, but in C++
>>>we usually include <cstdioinstead.
>>
>>I'm trying to get a handle on what makes a non standard header non
>>standard.
>
>Simple - if you can't find it in the standard, it ain't a standard
>header.
>
>Thus if you us it, your code isn't portable to other systems.

Is my text.h above in the standard? cordially, b
Of course not, but everything it includes is. Try and apply some common
sense.

All right. So you're not going to be able to include a file that
ultimately
includes an implemention-specific file such as windows.h , and drag it in
wholesale.

Is this:
#ifndef _WINDOWS_
#define _WINDOWS_
where windows.h craps out as standard? cordially, b
[begging the question and something about Muppets snipped]
I was apprised yesterday of Dr. Feit's passing. To be a character
associated with Frank Oz is fine with me. I am not the fastest of
creatures, that is, if REAL_LIFE is OT. Those who know the representation
half of Feit-Thompson know his influence on today's programmer. bfx
Jul 6 '06 #12

This discussion thread is closed

Replies have been disabled for this discussion.