# define and # undef are compiler directives in C and C++. The # define directive creates a definition for something that will be replaced multiple times in the code. For example: # define HELLO 5 Creates an association between HELLO and replaces it with 5 in the code (for the compiler only). The # undef (undefine) counterpart removes the definition from what the compiler sees. It is usually specified when either the definition should no longer be used or when the definition needs to change.
Actually, the preprocessor is not part of the C compiler, but here you are: #define is meant to define symbols. Examples #define NULL ((void *)0) #define getchar() getc(stdin)
1.type checking in const that is not a part of #define. 2.scope 3.debugging is possible with const.const variable can be localized whereas #define variable cannot be done so.#define simply replaces whatever you have defined by the text you want it to replace.const variable's value cannot be manipulated during the course of the program.#define is a text preprocessor command and like all text preprocessor commands (beginning with "#") are handled by textual substitution throughout the code before the compiler sees any of the code.const is a compiler keyword that identifies a constant declaration. It is handled by the actual compiler.
cross compiler . hybird compiler . post compiler. ideal compiler. intelligence compiler.
You could just define the whole function before it is called, like this:void do_nothing(){}main(){do_nothing();}but if you define the function after it is called, the compiler will arrive at the function's calling before its actual definition. If you prototype your function earlier in the code than the function's call, the compiler will look for the function first.Hope I was able to help.
# define and # undef are compiler directives in C and C++. The # define directive creates a definition for something that will be replaced multiple times in the code. For example: # define HELLO 5 Creates an association between HELLO and replaces it with 5 in the code (for the compiler only). The # undef (undefine) counterpart removes the definition from what the compiler sees. It is usually specified when either the definition should no longer be used or when the definition needs to change.
# define and # undef are compiler directives in C and C++. The # define directive creates a definition for something that will be replaced multiple times in the code. For example: # define HELLO 5 Creates an association between HELLO and replaces it with 5 in the code (for the compiler only). The # undef (undefine) counterpart removes the definition from what the compiler sees. It is usually specified when either the definition should no longer be used or when the definition needs to change.
Actually, the preprocessor is not part of the C compiler, but here you are: #define is meant to define symbols. Examples #define NULL ((void *)0) #define getchar() getc(stdin)
1.type checking in const that is not a part of #define. 2.scope 3.debugging is possible with const.const variable can be localized whereas #define variable cannot be done so.#define simply replaces whatever you have defined by the text you want it to replace.const variable's value cannot be manipulated during the course of the program.#define is a text preprocessor command and like all text preprocessor commands (beginning with "#") are handled by textual substitution throughout the code before the compiler sees any of the code.const is a compiler keyword that identifies a constant declaration. It is handled by the actual compiler.
POSSIBLE ANSWER I'm assuming you mean #define as used in C programming. This is a preprocessor definition. During compilation, the compiler reads all of the #define statements (and #include, and other statements starting with #). Then it begins compiling, replacing the tokens that were #define-d wherever they are found. This code: #define num 5 y = 3 + num; is seen by the compiler (after the preprocessor stage) as: y = 3 + 5; The same thing happens with #include, except instead of a short replacement such as "5" it replaces the #include line with an entire file.
cross compiler . hybird compiler . post compiler. ideal compiler. intelligence compiler.
You could just define the whole function before it is called, like this:void do_nothing(){}main(){do_nothing();}but if you define the function after it is called, the compiler will arrive at the function's calling before its actual definition. If you prototype your function earlier in the code than the function's call, the compiler will look for the function first.Hope I was able to help.
What is difference between Compiler and DML Compiler
In Compiler there is no design word ,whereas in compiler design there is design word
Yacc is a tool used to generate parsers for syntax analysis in programming languages. It stands for "Yet Another Compiler Compiler" and is often used in conjunction with Lex, another tool for lexical analysis. Yacc helps define the rules and grammar for processing input text.
What are the responsibities of a compiler
-Single pass compiler -Multi pass compiler -Cross compiler -Optimizing compiler