473,385 Members | 1,673 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.

a small precompiler question

hey guys

i was wondering what's the difference between the following commands:

#ifndef
#if !defined

looks to be the same or is it ?
Jun 27 '08 #1
5 1127
arjor wrote:

[it's preprocessor, not precompiler]
hey guys

i was wondering what's the difference between the following commands:

#ifndef
#if !defined

looks to be the same or is it ?
They are synonymous.

--
Ian Collins.
Jun 27 '08 #2
On 19 מאי, 01:13, Ian Collins <ian-n...@hotmail.comwrote:
arjor wrote:

[it's preprocessor, not precompiler]
hey guys
i was wondering what's the difference between the following commands:
#ifndef
#if !defined
looks to be the same or is it ?

They are synonymous.

--
Ian Collins.
Thanks for the quick reply
Jun 27 '08 #3
Ian Collins wrote:
arjor wrote:

[it's preprocessor, not precompiler]
>hey guys

i was wondering what's the difference between the following commands:

#ifndef
#if !defined

looks to be the same or is it ?

They are synonymous.
They are synonymous, except that !defined can be used in a preprocessor
expression...

e.g.:

#if !defined(THIS) && defined(THAT)

Jun 27 '08 #4
In article <3e67744b-5027-49e6-987a-646f97e27f51@
34g2000hsh.googlegroups.com>, as****@gmail.com says...
hey guys

i was wondering what's the difference between the following commands:

#ifndef
#if !defined

looks to be the same or is it ?
As-is, they're synonyms. The latter allows combinations of boolean logic
such as:

#if !defined(x) && !defined(y)

which are clumsier to produce with #ifndef.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Jun 27 '08 #5
On May 19, 2:23 am, r...@zedat.fu-berlin.de (Stefan Ram) wrote:
red floyd <no.s...@here.dudewrites:
>>i was wondering what's the difference between the following commands:
#ifndef
#if !defined
They are synonymous.
They are synonymous, except that !defined can be used in a
preprocessor expression...
This is not an exception to the assertion that these commands
are synonymous, because assertions about whether !defined
can be used in such an expression are not in the scope of the
assertion of the synonymity of these two preprocessor
commands.
Yes and no. In the first case, you have the preprocessor
command #ifndef, in the second the preprocessor command #if. It
really depends on what you consider is a "preprocessor command".
For another example, the statements i++; and ++i; are
synonymous, but the expressions i++ and ++i are not.
But the assertion about the expressions is not an exception
to the assertion about the statements.
Yes, but he clearly doesn't have a complete preprocessor
directive in either case, since there's no symbol after the
#ifndef or the defined.
However, the above preprocessor commands actually are not
commands at all, but directives - preprocessing directives.
What he wrote are not legal preprocessing directives. More is
needed. The first is considerably more restrictive with regards
to what that more can be.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique oriente objet/
Beratung in objektorientierter Datenverarbeitung
9 place Smard, 78210 St.-Cyr-l'cole, France, +33 (0)1 30 23 00 34

Jun 27 '08 #6

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

Similar topics

2
by: Carlos De Matos | last post by:
Hello all, Has anyone written a project/code/document on a possible implementation for a c# precompiler? I want to build a precompiler that will modify attributed code, then submit the...
8
by: Bill Pursell | last post by:
This question must be FAQ, but I can't find it: I'm baffled by the following: $ cat a.c #define foo(x) foo##x_ #define bar(x) bar##x##_ foo() foo(1) bar()
10
by: RainerF | last post by:
Hi Folks, My Problem is: My SQL Statement Structure: SELECT TABLEA.FIELDA, TABLEA.FIELDB, TABLEA.FIELDC, TABLEA.FIELDD,
22
by: JohnQ | last post by:
Is the C++ precompiler the same as a C precompiler? If not, how much different is it? John
104
by: JohnQ | last post by:
Well apparently not since one can step thru template code with a debugger. But if I was willing to make the concession on debugging, templates would be strictly a precompiler thing? I have a...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.