C C /C Programming MCQS Set-2 Sample Test,Sample questions

Question:
 Which of the following is correct about new and malloc?

1.Both are available in C

2.Pointer object initialization of a class with both new and malloc calls the constructor of that class

3.Pointer object initialization of a class using new involves constructor call whereas using malloc does not involve constructor call

4.Pointer object initialization of a class using malloc involves constructor call whereas using new does not involve constructor call


Question:
What is the difference between delete and delete[] in C++?

1.delete is used to delete normal objects whereas delete[] is used to pointer objects

2.delete is a keyword whereas delete[] is an identifier

3.delete is used to delete single object whereas delete[] is used to multiple(array/pointer of) objects

4.delete is syntactically correct but delete[] is wrong and hence will give an error if used in any case


Question:
What is virtual inheritance?

1.C++ technique to avoid multiple copies of the base class into children/derived class

2.C++ technique to avoid multiple inheritances of classes

3.C++ technique to enhance multiple inheritance

4. C++ technique to ensure that a private member of the base class can be accessed somehow


Question:
Which of the following is correct about new and malloc?
i) new is an operator whereas malloc is a function
ii) new calls constructor malloc does not
iii) new returns required pointer whereas malloc returns void pointer and needs to be typecast

1.i and ii

2. ii and iii

3.i and iii

4. i ii and iii


More MCQS

  1. C++ Programming MCQS Set-1
  2. C++ Multiple Choice Questions Set-1
  3. C++ Multiple Choice Questions Set-2
  4. C++ Programming MCQS Set-2
  5. C++ Programming MCQS Set-3
  6. C++ Programming MCQS Set-4
  7. C++ (CPP) MCQ Question with Answer
  8. Advanced c++ multiple choice question(MCQS)
  9. OOPS Quiz Questions and Answers(MCQS)
  10. C Programming - MCQ Questions Set 1
  11. C Programming - MCQ Questions Set 2
  12. C Programming - MCQ Questions Set 3
  13. C Programming - MCQ Questions Set 4
  14. C Programming - MCQ Questions Set 5
  15. C++ programming language MCQ Questions Set 1
  16. C++ programming language MCQ Questions Set 2
  17. C++ programming language MCQ Questions Set 3
  18. C++ programming language MCQ Questions Set 4
  19. C++ programming language MCQ Questions Set 5
  20. C++ Programming -Constructors and Destructors
  21. C++ Programming -OOPS Concepts
  22. C++ Programming - References
  23. C++ Programming - Functions
  24. C MCQS:-The ABC of C
  25. C MCQS Interview Questions
  26. C++ Questions and Answers OOPs Basic Concepts
  27. C++ Questions and Answers Returning Objects
  28. C Programming MCQ Part 1
  29. C Programming MCQ
  30. Computer Science & Engineering C Multiple Choice Questions set 1
  31. Computer Science & Engineering C Multiple Choice Questions set 2
  32. C Multiple Choice Questions C Functions Set 1
  33. C Multiple Choice Questions C Functions Set 2
  34. C Multiple Choice Questions C Operators
  35. C Multiple Choice Questions & AnswersConditional Expressions
  36. C Multiple Choice Questions & Answers Data Types
  37. C Multiple Choice Questions & Answers File Access
  38. Computer Science & Engineering Cloud Computing MCQs Part 1
  39. CPP Programming MCQ Set 1
  40. CPP Programming MCQ Set 2
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!