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 is c++ prototype?
why can't we declare data member of class auto register or extern
What is difference between c++ and c ++ 14?
If dog is a friend of boy, is boy a friend of dog?
How do I make turbo c++ full screen?
Explain the register storage classes in c++.
Write a c++ code that will calculate the roots of a quadratic equation a2+ bx+c=0 Hint: d = sqrt (b2-4ac), and the roots are: x1 = (€“b + d)/2a and x2 = (€“b €“ d)/2a (use sqrt function from cmath.h )?
What is the basic of c++?
Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c
show that among any group of five (not necessary consecutive ) integers, there are two with the same remainder when divided by 4.
What is late binding c++?
Can we define function inside main in c++?