Home / MCQ Bank / Computer
Computer Constructors And Destructors In C Plus Plus

What is the role of a constructor in classes?

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • To initialize the data members of an object when it is created

Related Computer Questions

What is the purpose of the binding method in Ruby? What is the maximum size of cookie? What is the output of the following code? #include<stdio.h> int recursive_search_num(int *arr, int num, int idx, int len) { if(idx == len) return -1; if(arr[idx] == num) return idx; return recursive_search_num(arr, num, idx+1, len); } int main() { int arr[8] ={1,2,3,3,3,5,6,7},num=5,len = 8; int indx = recursive_search_num(arr,num,0,len); printf("Index of %d is %d",num,indx); return 0; } If a particular rule should never be overridden by another rule, the ____________ indication should be used. Which of the following is not a mode in starting Windows?