Question 1
In C programming, which specifier in printf() is strictly used to display a pointer memory address in hexadecimal format?
Option B is correct. %p is the standard format specifier in C used to print pointer addresses in hexadecimal.
In C programming, which specifier in printf() is strictly used to display a pointer memory address in hexadecimal format?
Option B is correct. %p is the standard format specifier in C used to print pointer addresses in hexadecimal.
Which function in the C standard library is used to reallocate dynamic memory blocks while keeping existing data intact?
Option C is correct. realloc() changes the size of the memory block pointed to by a pointer while preserving the existing content up to the minimum of old and new sizes.
In C++, what is the default inheritance access mode when a derived class is declared using the 'class' keyword without specifying access specifiers?
Option A is correct. In C++, members and base classes default to private access when defined using the 'class' keyword, whereas they default to public when using the 'struct' keyword.
Which operator in C++ cannot be overloaded under any circumstances according to language specifications?
Option A is correct. In C++, non-overloadable operators include :: (scope resolution), . (member selection), .* (member pointer), ?: (ternary), and sizeof.
What happens if a class in C++ has at least one pure virtual function (e.g., virtual void show() = 0;)?
Option C is correct. A class containing at least one pure virtual function is an Abstract Class. Direct instantiation of abstract classes is prohibited by the C++ compiler.