If we declare two macro with the same identifier without
doing undef the first, what will be the result?
eg: #define MAX_SIZE 100
#define MAX_SIZE 200
int table1[MAX_SIZE];
Answers were Sorted based on User's Feedback
Answer / binoy mathew
#include <iostream>
#include <stdlib.h>
#define max 100
#define max 200
int main()
{
printf("%d",max);
return 0;
}
save and run.
[root@localhost Desktop]# g++ test.cpp
test.cpp:5:1: warning: "max" redefined
test.cpp:4:1: warning: this is the location of the previous
definition
[root@localhost Desktop]# ./a.out
200
it shows a warning, but the value used is the latest.
| Is This Answer Correct ? | 1 Yes | 0 No |
What does flush do?
How to implement flags?
What is public, protected, private in c++?
What is iomanip c++?
Why should we use null or zero in a program?
What is difference between c++ 11 and c++ 14?
What is struct c++?
Explain the differences between list x; & list x();.
Why c++ is so important?
Does c++ have finally?
What is the use of cmath in c++?
What is the difference between c++ and turbo c++?