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 |
Define private, protected and public access control.
When to use Multiple Inheritance?
What is a dynamic binding in c++?
What is binary object model?
Will a catch statement catch a derived exception if it is looking for the base class?
What is this weird colon-member (" : ") syntax in the constructor?
What is lvalue?
How will you call C functions from C ++ and vice-versa?
0 Answers Agilent, Tavant Technologies, Thomson Reuters, Verifone,
We use library functions in the program, in what form they are provided to the program?
What are namespaces in c++?
Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?
What's the hardest coding language?