C++ concepts

Description: C++ concepts
Number of Questions: 5
Created by:
Tags: c++
Attempted 0/5 Correct 0 Score 0

Types of Storage Class Variables

  1. Automatic

  2. Global

  3. Static

  4. External


Correct Option: A,C,D

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Automatic - This option is correct. Automatic storage class variables are local variables that are defined inside a function or block. They are created when the function or block is entered and destroyed when the function or block is exited. They have automatic storage duration, meaning they are allocated and deallocated automatically.

Option B) Global - This option is incorrect. Global variables have global scope and are accessible throughout the program. However, they do not fall under the storage class category.

Option C) Static - This option is correct. Static storage class variables are variables that are declared with the "static" keyword. They have static storage duration, meaning they are allocated and preserved throughout the program's execution. They retain their value between function calls and have a lifetime equal to the duration of the program.

Option D) External - This option is correct. External storage class variables are variables that are declared outside of any function or block. They have external storage duration, meaning they are allocated and preserved throughout the program's execution. They can be accessed by multiple source files in a program.

The correct answer is A, C, and D. These options represent the automatic, static, and external storage class variables.

__________ pointer is a type of pointer of any data type and generally takes a value as zero

  1. Vptr

  2. Void

  3. Null

  4. Zero


Correct Option: C

AI Explanation

To answer this question, you need to understand the concept of pointers in programming.

Option A) Vptr - This option is incorrect because "Vptr" is not a commonly used pointer type. It is not related to the concept of a pointer that takes a value as zero.

Option B) Void - This option is incorrect because "void" is not a pointer type. It is used as a return type for functions that do not return a value.

Option C) Null - This option is correct. "Null" is a special value that can be assigned to a pointer to indicate that it points to nothing. In many programming languages, including C and C++, a null pointer is represented by the value zero.

Option D) Zero - This option is incorrect because "Zero" is not a pointer type. It is simply a numerical value that represents the absence of a value.

The correct answer is C) Null. This option is correct because a null pointer is a type of pointer that generally takes a value of zero.

Which of the following statements are true?a. By default,all members of structure are private.b.new and delete operator can be overlaodedc.friend fucntion can overload [],(),= operators.

  1. a only

  2. a and b

  3. b only

  4. none of the above


Correct Option: C

During Compilation, The function call is replaced by function code for which function?

  1. Virtual functions

  2. Inline functions

  3. Static functions

  4. Friend functions


Correct Option: B

The idea of hiding data that are not needed for presentation is

  1. Encapuslation

  2. Abstraction

  3. Information Hiding

  4. Polymorphism


Correct Option: B
- Hide questions