CBSE eBooks CBSE Guess > eBooks > Class XII > Computer Science By . Mr. MRK
Chapter – 2. STRUCTURES 2006 Delhi: 1.b. Illustrate the use of #define in C++ to define a macro. 2 Ans: The #define preprocessor can be used in the creation of macros (code substitution). Eg: #define SQUARE(x) x*x Before compilation, if the C++ preprocessor finds SQUARE(x), where x is any value in the source code, it replaces it with its square (ie x*x). Here a macro substitutes text only; It does not check for data types. 1.C. Rewrite the following program after removing the syntactical error(s), if any.Underline each correction. 2 #include<iostream.h> Ans: #include<iostream.h> 1.f. What are Nested Structures? Give an example. 2 Ans: Nested structures are structures as member of another structure. For example, the date of birth is astructure within the structure of a student as shown below. These types of structures are known as nested structures.
|
|