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 |
Explain what happens when a pointer is deleted twice?
How const int *ourpointer differs from int const *ourpointer?
What is null pointer and void pointer?
Write a corrected statement in c++ so that the statement will work properly. x =+ 7;
Generally variables are stored in heap memory. When he variables are created in stack?
What is a vector c++?
How many characters are recognized by ANSI C++?
Differentiate between the message and method in c++?
Is c++ the most powerful language?
Disadvantages of c++
Define pre-condition and post-condition to a member function in c++?
What is flag in computer?