[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-391777-105":59,"doc-detail-391777-en":122},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":115,"head_meta":117,"extra_data":119,"updated_unix":121},105,"en","c-programming-mcqs-test-5-online-c-programming-test","C++ Programming MCQs Test 5 - Online C++ Programming Test","","C++ Programming MCQs Test 5 provides a set of multiple-choice questions covering core to advanced C++ concepts. The questions address exception specification, templates, const member functions, std::bad_alloc, and smart pointer-related headers. It also includes compiler-provided member rules, inheritance defaults, RTTI-related casting, STL programming paradigms, namespace purpose, exception catch-all handling, non-member operator design, STL container memory layout, and class member storage. A final section prompts submission of the test.",{"@graph":69,"@context":114},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":20,"@type":76,"position":81},"https://docshare.wps.com/document/exam/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/c-programming-mcqs-test-5-online-c-programming-test/391777/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/c-programming-mcqs-test-5-online-c-programming-test/391777.png","ImageObject",300,407,{"name":92,"@type":93},"Margaret","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-09","2026-09-25",true,{"@type":102,"interactionType":103,"userInteractionCount":44},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108],{"name":109,"@type":110,"acceptedAnswer":111},"When is std::bad_alloc thrown?","Question",{"text":112,"@type":113},"It is thrown when the new operator cannot allocate memory (allocation fails).","Answer","https://schema.org",{"og:url":83,"og:type":116,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":118,"canonical":83},"index,follow",{"doc_id":120,"site_id":62},391777,1790388949,{"code":4,"msg":5,"data":123},{"doc_id":120,"user_id":124,"nickname":92,"user_avatar":125,"doc_module":4,"category_id":19,"category_name":20,"doc_title":65,"doc_description":67,"doc_content":126,"file_id":127,"file_url":128,"file_type":129,"file_size":130,"view_count":44,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":34,"language":131,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":132,"faqs":133,"seo_title":134,"seo_description":67,"update_tm":135,"read_time":136,"preview_page_count":8,"preview_urls":137},137451207643,"https://ap-avatar.wpscdn.com/davatar_3d24733baf745e90a7e4bdd5f77d97b2","(/) 􀃻  \nC++ Programming MCQs Test 5  \nThis Test will cover complete C++ with very important questions, starting off from basics to advanced level.  \nQ. What is an exception specification?  \nA. DeclaraƟon of the list of excepƟons a funcƟon can throw using the throws clause.  \nB. Requirements speciﬁcaƟon of how to handle excepƟons in a program.  \nC. Design speciﬁcaƟon of how to handle excepƟon in a program.  \nD. SpeciﬁcaƟon document on excepƟon handling implementaƟon.  \nCorrect Answer : OPTION A, Declaration of the list of exceptions a function can throw using the throws clause.  \nQ. Which of the following cannot be declared as template ?  \nA. Global funcƟons  \nB. Classes  \nC. Member funcƟons  \nD. Macros  \nCorrect Answer : OPTION D, Macros. Macros are implemented in a preprocessor and cannot be implemented as a template. Functions and classes can be declared as templates.  \nQ. Which of the following is true about const member functions?  \n[https://www.studytonight.com/cpp/tests/12\\#](https://www.studytonight.com/cpp/tests/12#) 1/7  \nA. const members can be invoked on both const as well as nonconst objects  \nB. const members can be invoked only on const objects and not on nonconst objects  \nC. nonconst members can be invoked on const objects as well as nonconst objects  \nD. none of the above  \nCorrect Answer : OPTION A, const members can be invoked on both const as well as nonconst objects  \nQ. When is std::bad_alloc exception thrown?  \nA. When new operator cannot memory.  \nB. When alloc funcƟon fails  \nC. When type requested for new operaƟon is considered bad, this excepƟon is thrown  \nD. When delete operator cannot delete the allocated(corrupted) object.  \nCorrect Answer : OPTION A, When new operator cannot memory.  \nQ. Which header file should we include for using std::auto_ptr ?  \nA. memory  \nB. alloc  \nC. autoptr  \nD. smartptr  \nCorrect Answer : OPTION A, memory  \nQ. Which of the following member is not automatically provided by the compiler if the programmer does not provide it explicitly?  \n[https://www.studytonight.com/cpp/tests/12\\#](https://www.studytonight.com/cpp/tests/12#) 2/7  \nA. Constructor  \nB. Destructor  \nC. Equality operator ==  \nD. Assignment operator =  \nCorrect Answer : OPTION C, Equality operator(==)  \nQ. What is the default inheritance type when no access specifier is explicitly specified for the base class?  \nA. internal  \nB. public  \nC.private  \nD. protected  \nCorrect Answer : OPTION C, private  \nQ. Which of the following casting operators use RTTI(Runtime Type Identification)?  \nA. const_cast  \nB. staƟc_cast  \nC. dynamic_cast  \nD. reinterpret_cast  \nCorrect Answer : OPTION C, dynamic_cast. The dynamic_cast operator uses the runtime information about the type of the object for performing the cast.  \nQ. STL is based on which of the following programming paradigm?  \n[https://www.studytonight.com/cpp/tests/12\\#](https://www.studytonight.com/cpp/tests/12#) 3/7  \nA. Structured Programming  \nB. Object Oriented Programming(OOP)  \nC. FuncƟonal Programming  \nD. Aspect Oriented Programming(AOP)  \nCorrect Answer : OPTION C, Functional Programming  \nQ. Which of the following correctly describes the meaning of namespace feature in C++?  \nA. Namespaces refer to the memory space allocated for names used in a program.  \nB. Namespaces refer to space between the names in a program.  \nC. Namespaces refer to packaging structure of classes in a program.  \nD. Namespaces provide faciliƟes for organizing the names in a program to avoid name clashes.  \nCorrect Answer : OPTION D, Namespaces provide facilities for organizing the names in a program to avoid name clashes.  \nQ. Which of the following is the most general exception handler that catches exception of 'any type'?  \nA. catch(std::excepƟon)  \nB. catch(std::any_excepƟon)  \nC. catch(...)  \nD. catch()  \nCorrect Answer : OPTION C, catch(...)  \n[https://www.studytonight.com/cpp/tests/12\\#](https://www.studytonight.com/cpp/tests/12#) 4/7  \nQ. Which of the following operators can","cbCaioWbjkJs2PwQ","https://ap.wps.com/l/cbCaioWbjkJs2PwQ","pdf",234025,"English","# C++ Programming MCQs Test 5\n## Key C++ Concepts Covered","[{\"question\":\"When is std::bad_alloc thrown?\",\"answer\":\"It is thrown when the new operator cannot allocate memory (allocation fails).\"}]","C++ Programming MCQs Test 5 - Online C++ Programming Test | PDF",1790358634,18,[138],{"page_no":8,"url":139,"width":140,"height":141},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/75d385b67b3c08222863f667371f4151.webp",983,1391]