Hye friends,
1)I had seen in many of the *.h files that following are specified
#if !defined(__ALLOC_H)
#define __ALLOC_H
---------
some codes go through
#endif What is it's use? Why is it required ? Code can work well witout it also.
Moreover, what does allocate __ALLOC_H allocate in:
#define __ALLOC_H
Will __ALLOC_H be equal to 1 ?
2) How to write an program "swap two numbers by using temp. variable" by using MACRO
Please answer me
Comments
: Moreover, what does allocate __ALLOC_H allocate in: #define __ALLOC_H
: Will __ALLOC_H be equal to 1 ?
[blue]All that does is define a symbol -- it is not defined to be anything, just defined to the compiler.[/blue]
:
: 2) How to write an program "swap two numbers by using temp. variable" by using MACRO
:
: Please answer me
:
[blue]If you know how to do that without using a macro, then just create a macro with the same code -- just put a backslash at the end of each line to indicate a continuation line[/blue]
[code]
#define SWAY(a,b)
// rest of the code does here to swap
// the values of and b.
[/code]
:
: : Moreover, what does allocate __ALLOC_H allocate in: #define __ALLOC_H
: : Will __ALLOC_H be equal to 1 ?
:
: [blue]All that does is define a symbol -- it is not defined to be anything, just defined to the compiler.[/blue]
:
: :
: : 2) How to write an program "swap two numbers by using temp. variable" by using MACRO
: :
: : Please answer me
: :
: [blue]If you know how to do that without using a macro, then just create a macro with the same code -- just put a backslash at the end of each line to indicate a continuation line[/blue]
: [code]
: #define SWAY(a,b)
: // rest of the code does here to swap
: // the values of and b.
you must use brackets too
#define SWAY(a,b) {
// rest of the code does here to swap
// the values of and b. }
[/code]
: :
: : : Moreover, what does allocate __ALLOC_H allocate in: #define __ALLOC_H
: : : Will __ALLOC_H be equal to 1 ?
: :
: : [blue]All that does is define a symbol -- it is not defined to be anything, just defined to the compiler.[/blue]
: :
: : :
: : : 2) How to write an program "swap two numbers by using temp. variable" by using MACRO
: : :
: : : Please answer me
: : :
: : [blue]If you know how to do that without using a macro, then just create a macro with the same code -- just put a backslash at the end of each line to indicate a continuation line[/blue]
: : [code]
: : #define SWAY(a,b)
: : // rest of the code does here to swap
: : // the values of and b.
:
: you must use brackets too
: #define SWAY(a,b) {
: // rest of the code does here to swap
: // the values of and b. }
:
: [/code]
:
: Thanks for the help