473,385 Members | 1,620 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,385 software developers and data experts.

What is C preprocessor?

I am a novice, I want to know what is CPP, as showed in title. I
heared about it but the book I read do not mentioned it. Maybe
this book is too "introductory". Any one can give me a concept about it?
Mar 6 '07 #1
13 1781
"Zhou Yan" writes:
>I am a novice, I want to know what is CPP, as showed in title. I
heared about it but the book I read do not mentioned it. Maybe
this book is too "introductory". Any one can give me a concept about it
This should be helpful. Wikipedia is often helpful on computer related
problems.

http://en.wikipedia.org/wiki/C_preprocessor
Mar 6 '07 #2
Zhou Yan <zh*****@stu.ust.hkwrites:
I am a novice, I want to know what is CPP, as showed in title. I
heared about it but the book I read do not mentioned it. Maybe
this book is too "introductory". Any one can give me a concept about it?
Wikipedia has some information, although it's not the greatest treatment:
http://en.wikipedia.org/wiki/C_preprocessor
--
"The lusers I know are so clueless, that if they were dipped in clue
musk and dropped in the middle of pack of horny clues, on clue prom
night during clue happy hour, they still couldn't get a clue."
--Michael Girdwood, in the monastery
Mar 6 '07 #3

"Zhou Yan" <zh*****@stu.ust.hkwrote in message
news:m2************@stu.ust.hk...
I am a novice, I want to know what is CPP, as showed in title. I
heared about it but the book I read do not mentioned it. Maybe
this book is too "introductory". Any one can give me a concept about it?
Its not always implemented as a seprate program. In many compilers its now
part of the main compiler. So if you use GCC then the "-E" flag only run the
pre-processor.
Mar 6 '07 #4
"osmium" <r1********@comcast.netwrote:
"Zhou Yan" writes:
I am a novice, I want to know what is CPP, as showed in title. I
heared about it but the book I read do not mentioned it. Maybe
this book is too "introductory". Any one can give me a concept about it

This should be helpful. Wikipedia is often helpful on computer related
problems.
Not IMO. Wikipedia shovels data, but often does not provide knowledge.
The whole project is fundamentally flawed.
http://en.wikipedia.org/wiki/C_preprocessor
In this case, for example, that article is liable to leave the innocent
passer-by with a broken understanding of the C preprocessor. For
example, the second sentence in that article (as it was when I read it;
another problem with Wikipedia is that it is nearly impossible to
discuss any one article, since it may change behind the back of the
debaters) is already wrong on two counts.

Richard
Mar 7 '07 #5
Richard Bos <rl*@hoekstra-uitgeverij.nlwrote:
Not IMO. Wikipedia shovels data, but often does not provide knowledge.
The whole project is fundamentally flawed.
Surely that's a bit hyperbolic - the articles on a range of topics are
certainly adequate for most casual users.
In this case, for example, that article is liable to leave the innocent
passer-by with a broken understanding of the C preprocessor.
The range of topics I cited above does not really include any highly
technical and rigorously specified topics, including C, and yes, it's
generally not a good idea to rely on it for accurate technical
details.

--
C. Benson Manica | I *should* know what I'm talking about - if I
cbmanica(at)gmail.com | don't, I need to know. Flames welcome.
Mar 7 '07 #6
"Richard Bos" writes:
"osmium" <r1********@comcast.netwrote:
>This should be helpful. Wikipedia is often helpful on computer related
problems.

Not IMO. Wikipedia shovels data, but often does not provide knowledge.
The whole project is fundamentally flawed.
>http://en.wikipedia.org/wiki/C_preprocessor

In this case, for example, that article is liable to leave the innocent
passer-by with a broken understanding of the C preprocessor. For
example, the second sentence in that article (as it was when I read it;
another problem with Wikipedia is that it is nearly impossible to
discuss any one article, since it may change behind the back of the
debaters) is already wrong on two counts.
That's nothing! I once got a book out of the library and *it* was wrong. I
don't remember what book it was or what it said but it was definitely wrong
and so I have made it a point of avoiding the library ever since. Now, I
get most of my information from guys I strike up conversations with in
Starbucks.
Mar 7 '07 #7
Richard Bos wrote:
"osmium" <r1********@comcast.netwrote:
>"Zhou Yan" writes:
>>I am a novice, I want to know what is CPP, as showed in title. I
heared about it but the book I read do not mentioned it. Maybe
this book is too "introductory". Any one can give me a concept about it
This should be helpful. Wikipedia is often helpful on computer related
problems.

Not IMO. Wikipedia shovels data, but often does not provide knowledge.
The whole project is fundamentally flawed.
[OT, Naturally]

Like any encyclopedia, it is going to be incomplete, generalized and
open to argument. Wikipedia has roughly the same rate of error as other
printed encyclopedia; the types of errors are slightly different.

This is, in fact, all we really ask of encyclopedia.

For a gentle introduction to the C Preprocessor I wouldn't worry about
it. I bet my copy of K&R is wrong on some counts, too.
Mar 7 '07 #8

Christopher Benson-Manica wrote:
Richard Bos <rl*@hoekstra-uitgeverij.nlwrote:
Not IMO. Wikipedia shovels data, but often does not provide knowledge.
The whole project is fundamentally flawed.

Surely that's a bit hyperbolic - the articles on a range of topics are
certainly adequate for most casual users.
I think the more important issue is not the presence of errors, (as
any diverse collection of data is bound to have some errors), but the
scope for unrestrained editing and it's attendant vandalism. To be
fair, they've tried to alleviate it to some extent by allowing only
registered edits, but it's still open to abuse far more than a hard-
copy or non-wiki encyclopaedia, as the recent case of false identity,
(some university student posing successfully as a professor for
several years), demonstrates.

However it's popularity seems to be overshadowing it's problems.

Mar 7 '07 #9
On Wed, 7 Mar 2007 16:15:15 +0000 (UTC), in comp.lang.c , Christopher
Benson-Manica <at***@ukato.freeshell.orgwrote:
>Richard Bos <rl*@hoekstra-uitgeverij.nlwrote:
>Not IMO. Wikipedia shovels data, but often does not provide knowledge.
The whole project is fundamentally flawed.

Surely that's a bit hyperbolic - the articles on a range of topics are
certainly adequate for most casual users.
weeellll... it depends on your standards for correctness and how much
you care if you are mildly misinformed. The most accurate articles are
ones written by those with a form of obsessive-compulsive disorder
(say, about Klingon or Wombles). Anything to do with politics,
religion, science, history, etc etc tends to be subjective and many
articles are prone to conspiracy-theory-itis and muddleheadedness.

I tend to find the technical articles /fairly/ reliable, but one
invariably needs to x-ref to an independent source. I've come across
some hideously inaccurate stuff.
--
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
Mar 7 '07 #10
On Wed, 07 Mar 2007 13:59:35 -0500, in comp.lang.c , Clever Monkey
<cl**************@hotmail.com.invalidwrote:
>Like any encyclopedia, it is going to be incomplete, generalized and
open to argument. Wikipedia has roughly the same rate of error as other
printed encyclopedia; the types of errors are slightly different.
You're thinking of the so-called analysis carried out last year by
Nature. This was an extremely restrictive study and is considered at
best to be true only of the objectively measurable articles eg
science, technology or history. Anything subjective - eg biography,
politics, religion - is IMHO highly unreliable.
>This is, in fact, all we really ask of encyclopedia.
I ask somewhat more, frankly. I expect articles to be factual,
researched, verifiable and devoid of hearsay, rumour, opinion and
redisseminated misinformation.

--
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
Mar 7 '07 #11
"osmium" <r1********@comcast.netwrote:
"Richard Bos" writes:
"osmium" <r1********@comcast.netwrote:
This should be helpful. Wikipedia is often helpful on computer related
problems.
Not IMO. Wikipedia shovels data, but often does not provide knowledge.
The whole project is fundamentally flawed.
http://en.wikipedia.org/wiki/C_preprocessor
In this case, for example, that article is liable to leave the innocent
passer-by with a broken understanding of the C preprocessor. For
example, the second sentence in that article (as it was when I read it;
another problem with Wikipedia is that it is nearly impossible to
discuss any one article, since it may change behind the back of the
debaters) is already wrong on two counts.

That's nothing! I once got a book out of the library and *it* was wrong. I
don't remember what book it was or what it said but it was definitely wrong
and so I have made it a point of avoiding the library ever since. Now, I
get most of my information from guys I strike up conversations with in
Starbucks.
Be careful. They'll probably advise you to consult Wikipedia on
technical questions, and then you'll be worse off than when you started.

Richard
Mar 8 '07 #12
Mark McIntyre wrote:
On Wed, 07 Mar 2007 13:59:35 -0500, in comp.lang.c , Clever Monkey
<cl**************@hotmail.com.invalidwrote:
>Like any encyclopedia, it is going to be incomplete, generalized and
open to argument. Wikipedia has roughly the same rate of error as other
printed encyclopedia; the types of errors are slightly different.

You're thinking of the so-called analysis carried out last year by
Nature. This was an extremely restrictive study and is considered at
best to be true only of the objectively measurable articles eg
science, technology or history. Anything subjective - eg biography,
politics, religion - is IMHO highly unreliable.
I disagree. The analysis was very clear and the methodology was as
sound as one can expect from a short overview comparing specific subjects.
>This is, in fact, all we really ask of encyclopedia.

I ask somewhat more, frankly. I expect articles to be factual,
researched, verifiable and devoid of hearsay, rumour, opinion and
redisseminated misinformation.
Then you will have to do without, say, the Encyclopaedia Britannica,
which is known (we've both read the analysis above, and there are
excellent links to obviously wrong entries in printed encyclopedias that
have persisted for years, usually due to good old-fashioned plagiarism)
to have many factual errors that have persisted through several
editions, as well as the usual assortment of editorial slant that any
such collection of articles will suffer from.

The different model that Wikipedia employs vs. traditional encyclopedia
means different errors, not significantly more or less errors.

For an overview of a technical issue like cpp, pretty much any source is
fine. Augmenting this information with other sources to flesh things
out and cross-reference for errors is something we should all be doing.

Like I said, even my copy of K&R and the ISO C standard is wrong or
misleading on some accounts. Doing our best to ensure that facts are
researched, verifiable and devoid of hearsay is great; expecting that we
can /ever/ attain any sort of perfection in /any/ forum is unrealistic.

If the assertion is that, say, the Encyclopaedia Britannica is, on the
whole, "accurate, factual and verifiable" than Wikipedia then I have no
choice but to disagree. I'll take a global, personal perspective on
some subjects over a white, male prerogative any day of the week.

On the subject matter at hand, the C Preprocessor, it is likely that
Wikipedia has simply borrowed an old or incorrect report from some
previously published account, much like other sources (printed or not).

The difference is that some of the smart cookies here could offer
corrections to the text, which would be check, reviewed and accepted in
a matter of hours, usually.

Try that with the ISO C standard.

As a starting point, I will say again that starting with a Google search
that gets you to Wikipedia is not a bad way to start -- at least it will
give you better search terms. We go through life rationalizing bad or
missing information. An easy first error is assuming that some
particular source is definitive.
Mar 9 '07 #13
On Fri, 09 Mar 2007 16:03:48 -0500, in comp.lang.c , Clever Monkey
<cl**************@hotmail.com.invalidwrote:
>Mark McIntyre wrote:
>On Wed, 07 Mar 2007 13:59:35 -0500, in comp.lang.c , Clever Monkey
<cl**************@hotmail.com.invalidwrote:
You're thinking of the so-called analysis carried out last year by
Nature.
I disagree. The analysis was very clear and the methodology was as
sound as one can expect from a short overview comparing specific subjects.
Bollocks. I'm sorry, but if you really think that, you have no clue
how a proper scientific analysis of such data should be carried out.
>Then you will have to do without, say, the Encyclopaedia Britannica,
which is known to have many factual errors
Sure, in the small set of articles chosen by the Nature journalists
(nb not scientists). And unlike Wikipedia, the EB is subject to
peer-review by people who are actually knowledgeable, as opposed to by
anyone who recently read a sunday supplement or airport blockbuster.

By the way the article was /NOT/ a submitted paper, it was in the
editorial section of the magazine, written by journalists, and should
under no circumstances be confused with actual reviewed and
authenticated research.
>I'll take a global, personal perspective on
some subjects over a white, male prerogative any day of the week.
And may the Tower of Babel lean on you too. Your remark above by the
way is marginally racist & sexist and probably prejudiced against
intellectual study, though I'm not sure you intended it to be any of
those per se.

I'm saying nothing more on this topic.
--
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
Mar 9 '07 #14

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

Similar topics

220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
205
by: Jeremy Siek | last post by:
CALL FOR PAPERS/PARTICIPATION C++, Boost, and the Future of C++ Libraries Workshop at OOPSLA October 24-28, 2004 Vancouver, British Columbia, Canada http://tinyurl.com/4n5pf Submissions
24
by: Nudge | last post by:
I have an array, and an unrolled loop which looks like this: do_something(A); do_something(A); .... do_something(A); I thought: why should I type so much? I should write a macro. So I was...
9
by: Walter Roberson | last post by:
I have run into a peculiarity with SGI's C compiler (7.3.1.2m). I have been reading carefully over the ANSI X3.159-1989 specification, but I cannot seem to find a justification for the behaviour....
2
by: Paolo | last post by:
I imported a VC++6.0 project into VC++7.1. The conversion operation makes a mess with Preprocessor Definitions, adding a "$(NoInherit)" for each file. For example: I had a DLL project in VC++6.0...
17
by: zhangyue.zl | last post by:
static void (DEVICE_REQUEST)(void); What does this line declare in C? I am always meeting some codes like this,but I have never learnt that before. It looks like a declaration of a function,but...
25
by: Gernot Frisch | last post by:
Hi, I want to build a encryption macro set, that can crypt: char secret = CRYPT("KungFu"); to anything unreadable, and then have a function: char* DECRYPT(char* str) { ...
6
by: ludovicd | last post by:
Hi to all, There is my question, Let's say I got a fonction which takes a numeric argument long enough so that there has to be spaces in it to represent it correctly. (Ex. 0xf63a002c5ff0338ec...
31
by: Sam of California | last post by:
Is it accurate to say that "the preprocessor is just a pass in the parsing of the source file"? I responded to that comment by saying that the preprocessor is not just a pass. It processes...
14
by: lagman | last post by:
All, I'm looking for a tool that is able to take my code base (which is full of preprocessor directives) and spit out source code that is "clean" of any preprocessor directives based on the...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...

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.