|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
Explain #define preprocessor directive I am covering a topic called Preprocessor Directive in Csharp. I have learnt the #if preprocessor directive, but I am not able to grasp what is the #define preprocessor directive. How is it actually used? I have been using Java for along time but I am new to Csharp. I am totally confused over this topic. Reply fast. |
#2
| |||
| |||
Re: Explain #define preprocessor directive There is a huge similarity between C preprocessor and C sharp preprocessor. Infact the C sharp preprocessor are said to be derived from C programming language. the #define will allow you to define a symbol to be used as the #if directive's expression. Syntax: Code: #define symbol |
#3
| |||
| |||
Re: Explain #define preprocessor directive I am also a new programmer to Csharp programming. I find this very interesting and easy to learn and develop application for .NET Framework. This example will illustrate the use of #define preprocessor directive in C sharp. Code: #define Temp using System; public class A { public static void Main() { #if Temp Console.WriteLine("From #IF"); #endif Console.WriteLine() Console.WriteLine("Outside #IF"); } } |
#4
| |||
| |||
Re: Explain #define preprocessor directive C# preprocessor directives have alot of resemblence to the C preprocessor directives. The #define directive lets the programmer to define symbols which control the compilation of the C# code. #define preprocessor directive of C sharp defines a symbol whereas the #undef preprocessor directive of C sharp undefines a symbol.
__________________ The FIFA Manager 2009 PC Game |
![]() |
|
Tags: csharp, define, preprocessor, preprocessor directive |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
what is the use of iostream directive? | Diellza | Software Development | 4 | 08-01-2011 12:46 AM |
Explain how to define function outside the class in C++? | Palnila | Software Development | 4 | 29-12-2010 03:11 AM |
How can I use the pragma directive in C? | Tailor | Software Development | 3 | 21-01-2010 08:39 AM |
What is the meaning of Hypertext PreProcessor in PHP | Gefry | Software Development | 3 | 10-09-2009 10:28 AM |
PHP (Hypertext Preprocessor): Installation and Configuration - Manual | Pyrotechnic | Guides & Tutorials | 5 | 24-03-2009 10:45 PM |