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

predefined preprocessor constants

Does C# have any predefined preprocessor constants like the C/C++
compiler does? In C++ you had such predefined constants as:
__cplusplus, _DEBUG, _WIN32, MSC_VER.

Are there any such things for C#? It would be nice if there were some
for .Net version (1 or 2), compact framework or full framework, etc.

Thanks.

Randy Beckwith

Jan 27 '07 #1
2 4438
There are no predefined preprocessor directives in C#. You define your own,
either on the command line to the compiler, or in Visual Studio (or
web.config if it is an ASP.NET app). The Visual Studio Project setup
automatically inserts the "DEBUG" directive.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"me******@yahoo.com" wrote:
Does C# have any predefined preprocessor constants like the C/C++
compiler does? In C++ you had such predefined constants as:
__cplusplus, _DEBUG, _WIN32, MSC_VER.

Are there any such things for C#? It would be nice if there were some
for .Net version (1 or 2), compact framework or full framework, etc.

Thanks.

Randy Beckwith

Jan 27 '07 #2
They always take out the useful things... Thanks, Peter.

Randy
On Jan 27, 4:40 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
There are no predefined preprocessor directives in C#. You define your own,
either on the command line to the compiler, or in Visual Studio (or
web.config if it is an ASP.NET app). The Visual Studio Project setup
automatically inserts the "DEBUG" directive.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net

"merku...@yahoo.com" wrote:
Does C# have any predefined preprocessor constants like the C/C++
compiler does? In C++ you had such predefined constants as:
__cplusplus, _DEBUG, _WIN32, MSC_VER.
Are there any such things for C#? It would be nice if there were some
for .Net version (1 or 2), compact framework or full framework, etc.
Thanks.
Randy Beckwith
Jan 28 '07 #3

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

Similar topics

1
by: lwoods | last post by:
Sorry for previous email...hit the wrong key! Original Email: I ran the following code: <?php $a=get_defined_constants(); foreach($a as $key=>$value){ echo "$key = $value<br/>"; }
6
by: cody | last post by:
where can i find a list of all predefined preprocessor macros in c#? i searched in the msdn but i can't find it. i now there is at lest one: DEBUG. but what else? -- cody ...
5
by: Veit Wiessner | last post by:
I wrote a program that handles the buildcount of projects (gets called every time I compile a project, it writes a header file which is #include-ed in the project). My question is this, is it...
6
by: J.G.Harston | last post by:
I've been trying to track down explicit information about this for some time. I know that the ANSI C standard specifies the __* and _* macro namespace as reserved for the compiler implementation,...
5
by: sathya_me | last post by:
friends, Please go through the following code which I have downloaded from Bob Stout (Snippets): #include <stdio.h>
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....
9
by: ccwork | last post by:
Hi all, We can define some magic number with #define: #define OPERATION_1 0x00000001 #define OPERATION_2 0x00000002 #define OPERATION_3 0x00000003 .... We can also do that with enum: enum...
36
by: anon.asdf | last post by:
Hello! Can the proprocessor make conditional decisions. Here's an example of the functionality (not standard C!) #define PUT_BYTE(const_index, val) \ #preprocessor_if (const_index ==...
2
by: =?windows-1252?Q?=22=C1lvaro_G=2E_Vicario=22?= | last post by:
Is there any way to tell PHP predefined variables ($GLOBALS, $argv, $argc, $_GET, $_POST…) from *global* user-defined variables? Neither $GLOBALS nor get_defined_vars() put user data apart. I’m...
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,...
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...

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.