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

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 2408
"Christopher 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
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")%>...
0
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 ...
7
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...
1
by: Christopher M. Lusardi | last post by:
Hello, Is there anyway to do it other than using : #ifdef VAR1 ... #endif
19
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...
52
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...
2
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,...
19
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
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 //...
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:
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
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: 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
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...

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.