{"id":1068,"date":"2018-09-06T15:12:21","date_gmt":"2018-09-06T15:12:21","guid":{"rendered":"https:\/\/www.gologica.com\/blog\/?p=1068"},"modified":"2025-04-06T03:11:41","modified_gmt":"2025-04-06T03:11:41","slug":"c-interview-questions-and-answers","status":"publish","type":"post","link":"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/","title":{"rendered":"C++ Interview Questions and Answers"},"content":{"rendered":"<p><strong>What is C++?<br \/>\n<\/strong>C++ is an object oriented programming language created by Barnes Stroustrup. It is released in 1985.<\/p>\n<p><strong>What is the ADVANTAGES of C++<br \/>\n<\/strong>C++ doesn\u2019t only maintains all aspects from C language, it also simplify memory management and add several features like:<br \/>\nIncludes a new data type known as a class.<br \/>\nAllows object oriented programming.<\/p>\n<p><strong>What is full form of OOPS?<br \/>\n<\/strong>Object Oriented Programming System<\/p>\n<p><strong>What is a class?<br \/>\n<\/strong>Class is a collection of objects technically defining a class is designing an user defined data type.<\/p>\n<p><strong>What is an object?<br \/>\n<\/strong>An instance of the class is called as object. Or real time entity<\/p>\n<p><strong>What is abstraction?<\/strong><br \/>\nThe technique of creating user-defined data types, having the properties of built-in data types and a set of permitted operators that are well suited to the application to be programmed is known as data abstraction. Class is a construct for abstract data types (ADT).<\/p>\n<p><strong>What is encapsulation?<\/strong><br \/>\nIt is the mechanism that warping up of data and function into a single unit.<\/p>\n<p><strong>What is polymorphism?<br \/>\n<\/strong>Is a feature of OOPL that at run time depending upon the type of object the appropriate method is called?<\/p>\n<p><strong>What is inheritance?<br \/>\n<\/strong>Inheritance is the process of acquiring the properties of the exiting class into the new class. The existing class is called as base\/parent class and the inherited class is called as derived\/child class.<strong><br \/>\n<\/strong><\/p>\n<p><strong>List the types of inheritance supported in C++.<\/strong><\/p>\n<p>Single<\/p>\n<p>Multilevel<\/p>\n<p>Multiple<\/p>\n<p>Hierarchical<\/p>\n<p>Hybrid.<\/p>\n<table style=\"background: #d9dde2;\">\n<tbody>\n<tr>\n<td style=\"border: 1px solid black;\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a href=\"https:\/\/www.gologica.com\/course\/c\/\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-3219\" src=\"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-1.png\" alt=\"C++ Training\" width=\"850\" height=\"200\" srcset=\"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-1.png 850w, https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-1-460x108.png 460w, https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-1-768x181.png 768w, https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-1-100x24.png 100w, https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-1-600x141.png 600w, https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-1-120x28.png 120w, https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-1-310x73.png 310w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/a><\/p>\n<p><strong>What are the c++ tokens?<\/strong><br \/>\nc++ has the following tokens<br \/>\nI. keywords<br \/>\nII. Identifiers<br \/>\nIII. Constants<br \/>\nIV. Strings<br \/>\nV. operators<\/p>\n<p><strong>What is the difference between Array and List?<\/strong><br \/>\nArray is a collection of homogeneous elements while list is a collection of heterogeneous elements. Array memory allocation is static and continuous while List memory allocation is dynamic and random. In Array, users don\u2019t need to keep in track of next memory allocation while In list user has to keep in track of next location where memory is allocated.<\/p>\n<p><strong>What do you mean by reference variable in c++?<\/strong><br \/>\nA reference variable provides an alias to a previously defined variable.<br \/>\nData type &amp; reference-name = variable name<\/p>\n<p><strong>What is the difference between method overloading and method overriding?<\/strong><br \/>\nOverloading a method (or function) in C++ is the ability for functions of the same name to be defined as long as these methods have different signatures (different set of parameters). Method overriding is the ability of the inherited class rewriting the virtual method of the base class.<\/p>\n<p><strong>What is function overloading?<br \/>\n<\/strong>Defining several functions with the same name with unique list of parameters is called as function overloading.<\/p>\n<p><strong>What is operator overloading?<br \/>\n<\/strong>Defining a new job for the existing operator w.r.t the class objects is called as operator overloading.<\/p>\n<p><strong>What do you mean by inline function?<\/strong><br \/>\nAn inline function is a function that is expanded inline when invoked.ie. the compiler replaces the function call with the corresponding function code. An inline function is a function that is expanded in line when it is invoked. That is the compiler replaces the function call with the corresponding function code (similar to macro).<\/p>\n<p><strong>What is Static Member?<br \/>\n<\/strong>Static is a keyword in C++ used to give special characteristics to an element. Static elements are allocated storage only once in a program lifetime in static storage area. And they have a scope till the program lifetime.<\/p>\n<p><strong>What is a copy constructor?<br \/>\n<\/strong>A copy constructor is the constructor which take same class object reference as the parameter. It gets automatically invoked as soon as the object is initialized with another object of the same class at the time of its creation.<\/p>\n<p><strong>What is RECURSION ?<br \/>\n<\/strong>Function calling itself is called as recursion.<strong><br \/>\n<\/strong><\/p>\n<p><a href=\"https:\/\/www.gologica.com\/course\/c\/\"><img decoding=\"async\" class=\"alignnone size-full wp-image-3220\" src=\"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-2.png\" alt=\"C++ Live Training\" width=\"850\" height=\"200\" srcset=\"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-2.png 850w, https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-2-460x108.png 460w, https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-2-768x181.png 768w, https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-2-100x24.png 100w, https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-2-600x141.png 600w, https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-2-120x28.png 120w, https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C-Course-IMG-2-310x73.png 310w\" sizes=\"(max-width: 850px) 100vw, 850px\" \/><\/a><\/p>\n<p><strong>Is it possible to have a recursive inline function?<br \/>\n<\/strong>We can call an inline function from within itself; the compiler may not generate inline code since the compiler cannot determine the depth of recursion at compile time. A compiler with a good optimizer can inline recursive calls till some depth fixed at compile-time and insert non-recursive calls at compile time for cases when the actual depth gets exceeded at run time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is C++? C++ is an object oriented programming language created by Barnes Stroustrup. It is released in 1985. What &hellip;<\/p>\n","protected":false},"author":1,"featured_media":2105,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"pmpro_default_level":"","footnotes":""},"categories":[15223],"tags":[],"coauthors":[182],"class_list":["post-1068","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it-service-and-architecture","pmpro-has-access","user-has-not-earned"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>C++ Interview Questions and Answers - GoLogica<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C++ Interview Questions and Answers - GoLogica\" \/>\n<meta property=\"og:description\" content=\"What is C++? C++ is an object oriented programming language created by Barnes Stroustrup. It is released in 1985. What &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/\" \/>\n<meta property=\"og:site_name\" content=\"GoLogica\" \/>\n<meta property=\"article:published_time\" content=\"2018-09-06T15:12:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-06T03:11:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"175\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/61458e59d78b8e05fb57997461069c62\"},\"headline\":\"C++ Interview Questions and Answers\",\"datePublished\":\"2018-09-06T15:12:21+00:00\",\"dateModified\":\"2025-04-06T03:11:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/\"},\"wordCount\":694,\"image\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C.png\",\"articleSection\":[\"IT Service and Architecture\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/\",\"url\":\"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/\",\"name\":\"C++ Interview Questions and Answers - GoLogica\",\"isPartOf\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C.png\",\"datePublished\":\"2018-09-06T15:12:21+00:00\",\"dateModified\":\"2025-04-06T03:11:41+00:00\",\"author\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/61458e59d78b8e05fb57997461069c62\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/#primaryimage\",\"url\":\"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C.png\",\"contentUrl\":\"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C.png\",\"width\":300,\"height\":175,\"caption\":\"C++ Interview Questions\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.gologica.com\/elearning\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C++ Interview Questions and Answers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/#website\",\"url\":\"https:\/\/www.gologica.com\/elearning\/\",\"name\":\"GoLogica\",\"description\":\"E-Learning Portal\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.gologica.com\/elearning\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/61458e59d78b8e05fb57997461069c62\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/image\/d0ab308492a1bfcbec1a1ce1637996db\",\"url\":\"https:\/\/www.gologica.com\/elearning\/wp-content\/themes\/wplms\/assets\/images\/avatar.jpg\",\"contentUrl\":\"https:\/\/www.gologica.com\/elearning\/wp-content\/themes\/wplms\/assets\/images\/avatar.jpg\",\"caption\":\"admin\"},\"url\":\"https:\/\/www.gologica.com\/elearning\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C++ Interview Questions and Answers - GoLogica","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/","og_locale":"en_US","og_type":"article","og_title":"C++ Interview Questions and Answers - GoLogica","og_description":"What is C++? C++ is an object oriented programming language created by Barnes Stroustrup. It is released in 1985. What &hellip;","og_url":"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/","og_site_name":"GoLogica","article_published_time":"2018-09-06T15:12:21+00:00","article_modified_time":"2025-04-06T03:11:41+00:00","og_image":[{"width":300,"height":175,"url":"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C.png","type":"image\/png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/#article","isPartOf":{"@id":"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/"},"author":{"name":"admin","@id":"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/61458e59d78b8e05fb57997461069c62"},"headline":"C++ Interview Questions and Answers","datePublished":"2018-09-06T15:12:21+00:00","dateModified":"2025-04-06T03:11:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/"},"wordCount":694,"image":{"@id":"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C.png","articleSection":["IT Service and Architecture"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/","url":"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/","name":"C++ Interview Questions and Answers - GoLogica","isPartOf":{"@id":"https:\/\/www.gologica.com\/elearning\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/#primaryimage"},"image":{"@id":"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C.png","datePublished":"2018-09-06T15:12:21+00:00","dateModified":"2025-04-06T03:11:41+00:00","author":{"@id":"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/61458e59d78b8e05fb57997461069c62"},"breadcrumb":{"@id":"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/#primaryimage","url":"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C.png","contentUrl":"https:\/\/www.gologica.com\/elearning\/wp-content\/uploads\/2018\/09\/C.png","width":300,"height":175,"caption":"C++ Interview Questions"},{"@type":"BreadcrumbList","@id":"https:\/\/www.gologica.com\/elearning\/c-interview-questions-and-answers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.gologica.com\/elearning\/"},{"@type":"ListItem","position":2,"name":"C++ Interview Questions and Answers"}]},{"@type":"WebSite","@id":"https:\/\/www.gologica.com\/elearning\/#website","url":"https:\/\/www.gologica.com\/elearning\/","name":"GoLogica","description":"E-Learning Portal","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.gologica.com\/elearning\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/61458e59d78b8e05fb57997461069c62","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gologica.com\/elearning\/#\/schema\/person\/image\/d0ab308492a1bfcbec1a1ce1637996db","url":"https:\/\/www.gologica.com\/elearning\/wp-content\/themes\/wplms\/assets\/images\/avatar.jpg","contentUrl":"https:\/\/www.gologica.com\/elearning\/wp-content\/themes\/wplms\/assets\/images\/avatar.jpg","caption":"admin"},"url":"https:\/\/www.gologica.com\/elearning\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/posts\/1068","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/comments?post=1068"}],"version-history":[{"count":3,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/posts\/1068\/revisions"}],"predecessor-version":[{"id":3222,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/posts\/1068\/revisions\/3222"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/media\/2105"}],"wp:attachment":[{"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/media?parent=1068"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/categories?post=1068"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/tags?post=1068"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.gologica.com\/elearning\/wp-json\/wp\/v2\/coauthors?post=1068"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}