Rules For Constructing Variable Name Characters Allowed : Underscore(_) Capital Letters ( A - Z ) Small Letters ( a - z ) Digits ( 0 - 9 ) Blanks & Commas are not allowed No Special Symbols other than underscore(_) are allowed First Character should be alphabet or Underscore Variable name Should not be Reserved Word Explanation with Example(…)
Fundamental Attributes of Variable in C Programming
Fundamental Attributes of C Variable : Name of a Variable Value Inside Variable Address of Variable Size of a Variable Type of a Variable 1.Name of Variable We can Give proper name to any Variable which is human readable. Compiler won’t understand this name , This is only for human understanding. Variable name is only(…)
Macro Taking Argument in C | Argumented Macro Preprocessor inC Programming
Pre-processor Macro taking Argument : Argumented Macro (Macro having Arguments) Everytime whenever the macro name is encountered , the arguments are replaced by the actual arguments from the program. Macroname having Arguments is called Argumented Macro. Argumented macro is as called as function macro as it looks like calling function. Advantages of Argumented macro :(…)
Preprocessor Directive MCQ 1 : Pre Incrementing Macro
Guess What will be the output of following Code Snippet - #include<stdio.h> #define MAX 10 int main(){ int num; num = ++MAX; printf(“%d”,num); return 0; } Options : 10 11 Compile Error Run-time Error Compile Error Explanation : num = ++MAX; will be expanded as - num = ++10; = Compile Error Macro Preprocessor only(…)
Nested Preprocessor Macro directive having Arguments in C Programming
How to use Nested Macro ? These are Macros having Arguments Every time whenever the macro name is encountered , the arguments are replaced by the actual arguments from the program. Macro name within another macro is called Nesting of Macro. Use of Nested Macro : #define CUBE(x) (SQU(x)*x) Live Example : #include<stdio.h> #define SQU(x)((x)*x)(…)
#define Preprocessor Directive in C | Simple Substitution Macro
Simple Substitution Macro : #define Preprocessor in C Syntax #define macro_identifier value Note #define Preprocessor defines a identifier and a value that is substituted for identifier each time it is encountered in the source file Generally macro-identifier is written in the Capital Letter to distinguish it from other variables. Its like a name-value Pair. Examples(…)
What Pre-processor Directive do ? | Tasks Performed by Preprocessor Directive
Tasks Performed by Preprocessor Directive | What Pre-processor Directive do ? What is Preprocessor : Program that Processes or Analyzes the source code file before Given to the Compiler is called as Pre-Processor Refer this Article to know better : [ What is preprocessor? ] Tasks Performed by Pre-processor Directive in C Replaces Trigraph Sequences Joins any(…)
How C Processor Works | Processing of Preprocessor Directives with Flowchart
We all know that preprocessor comes before compiler so complete source code will be first processed by the preprocessor and then output will be given to the compiler. How C Processor Works | Processing of Preprocessor Directives with Flowchart following flowchart clearly explains the working of Pre-processor Directive - Explanation of Working : Step 1(…)
File Inclusive Directives >> C Preprocessor Directives
File Inclusive Directives File inclusive Directories are used to include user define header file inside C Program. File inclusive directory checks included header file inside same directory (if path is not mentioned). File inclusive directives begins with #include If Path is mentioned then it will include that header file into current scope. Instead of using triangular brackets(…)
Tasks Performed By Pre-processor
Preprocessor : Program that Processes or Analyzes the source code file before Given to the Compiler Tasks Performed By Pre-processor : Replaces Trigraph Sequences Joins any Line with the Backslash Character into Single Line Divide Program into Set of Tokens Expand Macroes Remove Comments and Replace it by Single Space Represent the Escape Sequence by(…)