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];

Answer Posted / ahmed

It will be 200
This is why #define is considered as unsafe type when
compared to const variables

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between a definition and a declaration?

829


Tell me what are static member functions?

818


Is c++ harder than java?

811


What is meant by const_cast?

872


Explain the concept of copy constructor?

825


How do you declare A pointer to a function which receives nothing and returns nothing

964


What is conditions when using boolean operators?

848


Why can’t you call invariants() as the first line of your constructor?

782


what are the iterator and generic algorithms.

1911


Can char be a number c++?

802


What is the use of main function in c++?

753


What are friend functions in C++?

827


What function initalizes variables in a class: a) Destructor b) Constitutor c) Constructor

918


When to use “const” reference arguments in a function?

826


Differentiate between structure and class in c++.

812