473,799 Members | 3,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to replace: #if VAR1 == 100 ... #elif VAR2 = 1 ... #endif, With #ifdef VAR1 ... ? ... #endif

Hello,

Is there anyway to do it other than using :
#ifdef VAR1

...
#endif
#ifdef VAR2
...
#endif
Thank you,
Christopher Lusardi
Jul 22 '05 #1
1 2445
"Christophe r M. Lusardi" <cl********@aol .com> wrote...
Hello,

Is there anyway to do it other than using :
#ifdef VAR1

...
#endif
#ifdef VAR2
...
#endif

I am honestly not sure what you want, but

#ifdef blah

is equivalent to

#if defined(blah)

so you could write

#if defined(VAR1)
...
#elif defined(VAR2)
...
#endif

Of course, it's not going to work if you really need to branch
depending on the _value_ of VAR1...

V
Jul 22 '05 #2

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

Similar topics

3
1568
by: Targa | last post by:
Hi, Im working with 3 query strings that I dont have control over: mypage.asp?var1=<%=request("somevalue")%> mypage.asp?var2=<%=request("somevalue")%> mypage.asp?var3=<%=request("somevalue")%> My application is expecting only var1. How can I implement a replace function to replace the var2, and var3 parts to always be var1?
0
1204
by: DaveJG | last post by:
I have a couple of questions involving the search/replace in the IDE and regular expressions. Any help would be greatly appreciated. 1. How would I replace two line feeds with one? That is Var1 = 1 Var2 = 2 becomes
7
2481
by: malli | last post by:
hi i am very new to c and c++ In my few days experience i came to know that we should use incrementing operator as follows var1+=var2 var1-=var2 var1*=var2 var1/=var2 why don't we use the above assignment statements as follows.I mean why don't the developers of c & c++ used the following notations as incrementing and decrementing operators
1
402
by: Christopher M. Lusardi | last post by:
Hello, Is there anyway to do it other than using : #ifdef VAR1 ... #endif
19
78846
by: Paul | last post by:
hi, there, for example, char *mystr="##this is##a examp#le"; I want to replace all the "##" in mystr with "****". How can I do this? I checked all the string functions in C, but did not find one.
52
6360
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible variations(combination of fields), - then act on each group in some way ...eg ProcessRs (oRs as RecordSet)... the following query will get me the distinct groups
2
2599
by: Charles Sullivan | last post by:
I'm trying to maintain some older C code (FOSS) which has been patched by various individuals over the years for portability to multiple Unix-like operating systems, to wit: Linux, SunOS, Solaris, Free/Open/NetBSD, Mac OS X, AT&T SysV r4, SCO Unix, AIX, OSF, NextStep. I want to add some conditionals like this: #if defined(USECODE_A) /*use this code */
19
1450
by: Hrvoje Voda | last post by:
I'm using 2 integer numbers X and Y. I would like to replace there values(Y=X, X=Y) but without using any other variables or functions. Hrcko
2
8317
by: John Doe | last post by:
Hi, I would like to know if it would be possible to replace _T() macros used on windows to delcare an ANSI string or a unicode one : #ifdef UNICODE #define __TEXT(quote) L##quote // r_winnt #else #define __TEXT(quote) ##quote #endif
0
9687
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
10252
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
10027
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
9073
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
6805
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
5463
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
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
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
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.