adplus-dvertising
frame-decoration

Question

Which of the following is correct about class and structure?

a.

class can have member functions while structure cannot.

b.

class data members are public by default while that of structure are private.

c.

Pointer to structure or classes cannot be declared.

d.

class data members are private by default while that of structure are public by default.

Answer: (d).class data members are private by default while that of structure are public by default.

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following is correct about class and structure?

Similar Questions

Discover Related MCQs

Q. Which of the following concepts means wrapping up of data and functions together?

Q. Which of the following concepts means waiting until runtime to determine which function to call?

Q. Which of the following functions are performed by a constructor?

Q. The address of a variable temp of type float is

Q. What is the output of the following code :
char symbol[3]={‘a’,‘b’,‘c’};
for (int index=0; index<3; index++)
cout << symbol [index];

Q. The process of building new classes from existing one is called ______.

Q. If a class C is derived from class B, which is derived from class A, all through public inheritance, then a class C member function can access

Q. If the variable count exceeds 100, a single statement that prints “Too many” is

Q. Usually a pure virtual function

Q. To perform stream I/O with disk files in C++, you should

Q. Overloading the function operator

Q. In C++, the range of signed integer type variable is ________

Q. If x = y,5 = 2 then x ∧ y equals________.

(where ∧ is a bitwise XOR operator)

Q. If an array is declared as
int a[4] = {3, 0, 1, 2}, then values assigned to a[0] & a[4] will be ________.

Q. Mechanism of deriving a class from another derived class is known as____

Q. RunTime Polymorphism is achieved by ______

Q. A function call mechanism that passes arguments to a function by passing a copy of the values of the arguments is __________

Q. In C++, dynamic memory allocation is accomplished with the operator ____

Q. If we create a file by ‘ifstream’, then the default mode of the file is _________

Q. A variable defined within a block is visible