<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Virtual Function in C++ - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/virtual-function-in-c/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/virtual-function-in-c/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Fri, 19 Aug 2022 12:34:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>Virtual Function in C++ - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/virtual-function-in-c/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What are Virtual functions in C++ ?</title>
		<link>https://www.wikitechy.com/interview-questions/cpp/what-are-virtual-functions-in-cpp/</link>
					<comments>https://www.wikitechy.com/interview-questions/cpp/what-are-virtual-functions-in-cpp/#respond</comments>
		
		<dc:creator><![CDATA[webmaster]]></dc:creator>
		<pubDate>Fri, 19 Aug 2022 12:34:29 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[advantages of virtual function in c++]]></category>
		<category><![CDATA[C++ virtual function]]></category>
		<category><![CDATA[C++ Virtual Functions]]></category>
		<category><![CDATA[virtual and pure virtual function in c++]]></category>
		<category><![CDATA[virtual class in c++]]></category>
		<category><![CDATA[virtual function example]]></category>
		<category><![CDATA[Virtual Function in C++]]></category>
		<category><![CDATA[what is pure virtual function in c++]]></category>
		<category><![CDATA[what is virtual function]]></category>
		<category><![CDATA[Why do we need virtual functions in C++?]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=4820</guid>

					<description><![CDATA[Virtual function is a member function which is re-defined by a derived class and declared within a base class. When you refer to a derived class object using a reference or pointer to the base class, you can call a virtual function for that object and execute the derived class’s version of the function. It [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li style="text-align: justify;">Virtual function is a member function which is re-defined by a derived class and declared within a base class.</li>
<li style="text-align: justify;">When you refer to a derived class object using a reference or pointer to the base class, you can call a virtual function for that object and execute the derived class’s version of the function.</li>
<li style="text-align: justify;">It ensures that the correct function is called for an object, regardless of the type of reference used for function call.</li>
<li style="text-align: justify;">It is mainly used to achieve Run-time polymorphism.</li>
<li style="text-align: justify;">In base class functions are declared with a <strong>virtual. </strong>At run time the resolving of function call is done.</li>
</ul>
<h2 id="sample-code" style="text-align: justify;">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-cpp code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-cpp code-embed-code">using namespace std;<br/> <br/>class base {<br/>public:<br/>    virtual void print()<br/>    {<br/>        cout &lt;&lt; &quot;print base class\n&quot;;<br/>    }<br/> <br/>    void show()<br/>    {<br/>        cout &lt;&lt; &quot;show base class\n&quot;;<br/>    }<br/>};<br/> <br/>class derived : public base {<br/>public:<br/>    void print()<br/>    {<br/>        cout &lt;&lt; &quot;print derived class\n&quot;;<br/>    }<br/> <br/>    void show()<br/>    {<br/>        cout &lt;&lt; &quot;show derived class\n&quot;;<br/>    }<br/>};<br/> <br/>int main()<br/>{<br/>    base *bptr;<br/>    derived d;<br/>    bptr = &amp;d;<br/> <br/>    // Virtual function, binded at runtime<br/>    bptr-&gt;print();<br/> <br/>    // Non-virtual function, binded at compile time<br/>    bptr-&gt;show();<br/>   <br/>    return 0;<br/>}</code></pre> </div>
<h2 id="output" style="text-align: justify;">Output</h2>
<p style="text-align: justify;"><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4821" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/virtual-function.png" alt="" width="875" height="162" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/virtual-function.png 875w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/virtual-function-300x56.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/virtual-function-768x142.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/virtual-function-390x72.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2022/08/virtual-function-820x152.png 820w" sizes="(max-width: 875px) 100vw, 875px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/cpp/what-are-virtual-functions-in-cpp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Which type of inheritance needs a virtual function ?</title>
		<link>https://www.wikitechy.com/interview-questions/programming/which-type-of-inheritance-needs-a-virtual-function/</link>
					<comments>https://www.wikitechy.com/interview-questions/programming/which-type-of-inheritance-needs-a-virtual-function/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Fri, 27 Aug 2021 00:47:53 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[advantages of virtual function in c++]]></category>
		<category><![CDATA[c++ - virtual function in private or protected inheritance]]></category>
		<category><![CDATA[C++ "virtual" keyword for functions in derived classes]]></category>
		<category><![CDATA[Do virtual functions have to be overridden]]></category>
		<category><![CDATA[inheritance - C++ Virtual function implementation]]></category>
		<category><![CDATA[inheritance virtual function]]></category>
		<category><![CDATA[inheritance virtual functionpure virtual function in c++]]></category>
		<category><![CDATA[Most Asked Sapient Nitro Interview Questions]]></category>
		<category><![CDATA[pure virtual function in c++]]></category>
		<category><![CDATA[pure virtual function program in c]]></category>
		<category><![CDATA[Virtual function and inheritance in C++]]></category>
		<category><![CDATA[virtual function c++]]></category>
		<category><![CDATA[virtual function call mechanism in c++]]></category>
		<category><![CDATA[Virtual Function in C++]]></category>
		<category><![CDATA[virtual function in inheritance]]></category>
		<category><![CDATA[virtual function in java]]></category>
		<category><![CDATA[What is need of virtual function]]></category>
		<category><![CDATA[What is virtual function in C]]></category>
		<category><![CDATA[What is virtual inheritance]]></category>
		<category><![CDATA[Which type of inheritance needs a virtual function]]></category>
		<category><![CDATA[Why do we need virtual function]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=2589</guid>

					<description><![CDATA[Answer : D. All of the above]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<p class="color-pink">Which type of inheritance needs a virtual function ?</p>
<div class="row">
<div class="col-sm-6">
<p>A. <a href="https://www.wikitechy.com/tutorials/c++/c++-multiple-inheritance" target="_blank" rel="noopener">Multi level inheritance</a></p>
</div>
<div class="col-sm-6">
<p>B. <a href="https://www.wikitechy.com/tutorials/c++/c++-multiple-inheritance" target="_blank" rel="noopener">Multiple inheritance</a></p>
</div>
<div class="col-sm-6">
<p>C. Hybrid inheritance</p>
</div>
<div class="col-sm-6">
<p>D. All of the above</p>
</div>
</div>
</div>
</div>
<h3 id="answer-d-all-of-the-above"><b>Answer : </b>D. All of the above</h3>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/programming/which-type-of-inheritance-needs-a-virtual-function/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Find the wrong statement about Abstract Class ?</title>
		<link>https://www.wikitechy.com/interview-questions/cpp/find-the-wrong-statement-about-abstract-class/</link>
					<comments>https://www.wikitechy.com/interview-questions/cpp/find-the-wrong-statement-about-abstract-class/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Mon, 12 Jul 2021 22:54:00 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[abstract class in c++]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[BMC Software interview questions and answers]]></category>
		<category><![CDATA[Bosch India Software interview questions and answers]]></category>
		<category><![CDATA[c++ abstract class]]></category>
		<category><![CDATA[c++ abstract class constructor]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[eInfochips interview questions and answers]]></category>
		<category><![CDATA[Electronics Arts Inc interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[Harman International interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[interface and abstract class in c++]]></category>
		<category><![CDATA[interface is partial abstract class true or false]]></category>
		<category><![CDATA[Larsen & Toubro interview questions and answers]]></category>
		<category><![CDATA[Mathworks India Private Limited interview questions and answers]]></category>
		<category><![CDATA[Mavenir interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Philips Software Centre Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[pure virtual class in c++]]></category>
		<category><![CDATA[pure virtual function in c++]]></category>
		<category><![CDATA[Sapient Technical and HR Interview Questions]]></category>
		<category><![CDATA[SRM Technologies interview questions and answers]]></category>
		<category><![CDATA[Symphony Teleca interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[Tecnotree interview questions and answers]]></category>
		<category><![CDATA[use of abstract class in c++]]></category>
		<category><![CDATA[use of virtual function in c++]]></category>
		<category><![CDATA[uses of abstract class in c++]]></category>
		<category><![CDATA[virtual base class in c++]]></category>
		<category><![CDATA[virtual destructor in c++]]></category>
		<category><![CDATA[Virtual Function in C++]]></category>
		<category><![CDATA[we can declare abstract method outside of abstract class mcq]]></category>
		<category><![CDATA[we can declare abstract method outside of abstract class true or false]]></category>
		<category><![CDATA[which of the following is true about abstract classes]]></category>
		<category><![CDATA[which of the following is used to make an abstract class mcq]]></category>
		<category><![CDATA[which of the following statement is false about abstract classes]]></category>
		<category><![CDATA[which statement is incorrect with respect to abstract class]]></category>
		<category><![CDATA[which statement is incorrect with respect to abstract class in c++]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<category><![CDATA[Wipro interview questions and answers]]></category>
		<category><![CDATA[Yash Technologies interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=386</guid>

					<description><![CDATA[Answer : B. We can’t create pointers to an abstract class]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h3 id="find-the-wrong-statement-about-abstract-class" class="color-pink" style="text-align: justify;">Find the wrong statement about Abstract Class ?</h3>
<div class="row" style="text-align: justify;">
<div class="col-sm-6">
<p>A. We can’t create its objects</p>
</div>
<div class="col-sm-6">
<p>B. We can’t create pointers to an abstract class</p>
</div>
<div class="col-sm-6">
<p>C. It contains at least one pure virtual function</p>
</div>
<div class="col-sm-6">
<p>D. We can create references to an abstract class</p>
</div>
</div>
<h3 id="answer-b-we-cant-create-pointers-to-an-abstract-class" style="text-align: justify;"><b>Answer : </b>B. We can’t create pointers to an abstract class</h3>
</div>
</div>
<div class="subheading" style="text-align: justify;">
<h2 id="explanation">Explanation :</h2>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Abstract Class is a class which contains atleast one Pure Virtual function.</li>
<li>An abstract class is a class that is designed to be specifically used as a base class.</li>
<li>It is used to provide an Interface for its sub classes.</li>
<li>Classes inheriting an Abstract Class must provide definition to the pure virtual function, otherwise they will also become abstract class.</li>
<li>You declare a pure virtual function by using a <b>pure specifier (= 0)</b> in the declaration of a virtual member function in the class declaration.</li>
</ul>
</div>
</div>
<div class="subheading" style="text-align: justify;">
<h2 id="example" class="color-green">Example</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-cpp code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-cpp code-embed-code">class AB {<br/>public:<br/>  virtual void f() = 0;<br/>};</code></pre> </div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/cpp/find-the-wrong-statement-about-abstract-class/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>C++ supports run time polymorphism with the help of virtual functions, which is called ______ binding</title>
		<link>https://www.wikitechy.com/interview-questions/cpp/c-supports-run-time-polymorphism-with-the-help-of-virtual-functions-which-is-called-______-binding/</link>
					<comments>https://www.wikitechy.com/interview-questions/cpp/c-supports-run-time-polymorphism-with-the-help-of-virtual-functions-which-is-called-______-binding/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Mon, 12 Jul 2021 22:49:38 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[BMC Software interview questions and answers]]></category>
		<category><![CDATA[Bosch India Software interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[compile time polymorphism in c++]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[eInfochips interview questions and answers]]></category>
		<category><![CDATA[Electronics Arts Inc interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[Harman International interview questions and answers]]></category>
		<category><![CDATA[how runtime polymorphism is achieved in c++]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Larsen & Toubro interview questions and answers]]></category>
		<category><![CDATA[Mathworks India Private Limited interview questions and answers]]></category>
		<category><![CDATA[Mavenir interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[need of virtual function in c++]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Philips Software Centre Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[polymorphism and virtual function in c++]]></category>
		<category><![CDATA[polymorphism example]]></category>
		<category><![CDATA[polymorphism in c++ with example programpolymorphism in c++]]></category>
		<category><![CDATA[polymorphism programming]]></category>
		<category><![CDATA[polymorphism programmingcompile time polymorphism in c++]]></category>
		<category><![CDATA[pure virtual function in c++]]></category>
		<category><![CDATA[runtime polymorphism]]></category>
		<category><![CDATA[runtime polymorphism in c++]]></category>
		<category><![CDATA[runtime polymorphism is achieved by virtual function in c++]]></category>
		<category><![CDATA[Sapient Technical and HR Interview Questions]]></category>
		<category><![CDATA[SRM Technologies interview questions and answers]]></category>
		<category><![CDATA[Symphony Teleca interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[Tecnotree interview questions and answers]]></category>
		<category><![CDATA[types of polymorphism in c++]]></category>
		<category><![CDATA[use of virtual function in c++]]></category>
		<category><![CDATA[Virtual Function in C++]]></category>
		<category><![CDATA[virtual function in c++ with example]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<category><![CDATA[Wipro interview questions and answers]]></category>
		<category><![CDATA[Yash Technologies interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=384</guid>

					<description><![CDATA[Answer : A. Dynamic]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h3 id="c-supports-run-time-polymorphism-with-the-help-of-virtual-functions-which-is-called-______-binding" class="color-pink" style="text-align: justify;">C++ supports run time polymorphism with the help of virtual functions, which is called ______ binding.</h3>
<div class="row" style="text-align: justify;">
<div class="col-sm-6">
<p>A. Dynamic</p>
</div>
<div class="col-sm-6">
<p>B. Run time</p>
</div>
<div class="col-sm-6">
<p>C. Early binding</p>
</div>
<div class="col-sm-6">
<p>D. Static</p>
</div>
</div>
<h3 id="answer-a-dynamic" style="text-align: justify;"><b>Answer : </b>A. Dynamic</h3>
</div>
</div>
<div class="subheading" style="text-align: justify;">
<h2 id="explanation">Explanation :</h2>
</div>
<div class="Content">
<div class="hddn">
<ul>
<li style="text-align: justify;">Dynamic binding (dynamic dispatch) means that a block of code executed with reference to a procedure call is determined at run time.</li>
</ul>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/cpp/c-supports-run-time-polymorphism-with-the-help-of-virtual-functions-which-is-called-______-binding/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A virtual function that has no definition within the base class is called ?</title>
		<link>https://www.wikitechy.com/interview-questions/cpp/a-virtual-function-that-has-no-definition-within-the-base-class-is-called/</link>
					<comments>https://www.wikitechy.com/interview-questions/cpp/a-virtual-function-that-has-no-definition-within-the-base-class-is-called/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Mon, 12 Jul 2021 22:45:35 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[abstract class in c++ with simple example]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[advantages of virtual function in c++]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[BMC Software interview questions and answers]]></category>
		<category><![CDATA[Bosch India Software interview questions and answers]]></category>
		<category><![CDATA[c++ virtual function = 0]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[eInfochips interview questions and answers]]></category>
		<category><![CDATA[Electronics Arts Inc interview questions and answers]]></category>
		<category><![CDATA[explain pure virtual function with example program]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[Harman International interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[interview questions on virtual functions in c++]]></category>
		<category><![CDATA[Larsen & Toubro interview questions and answers]]></category>
		<category><![CDATA[Mathworks India Private Limited interview questions and answers]]></category>
		<category><![CDATA[Mavenir interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[need of virtual function in c++]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Philips Software Centre Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[pure virtual function]]></category>
		<category><![CDATA[pure virtual function c++ example]]></category>
		<category><![CDATA[pure virtual function call]]></category>
		<category><![CDATA[pure virtual function in c++]]></category>
		<category><![CDATA[pure virtual function in c++ with example program]]></category>
		<category><![CDATA[Sapient Technical and HR Interview Questions]]></category>
		<category><![CDATA[SRM Technologies interview questions and answers]]></category>
		<category><![CDATA[Symphony Teleca interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[Tecnotree interview questions and answers]]></category>
		<category><![CDATA[use of pure virtual function in c++]]></category>
		<category><![CDATA[use of virtual function in c++]]></category>
		<category><![CDATA[virtual and pure virtual function]]></category>
		<category><![CDATA[virtual class in c++]]></category>
		<category><![CDATA[virtual function]]></category>
		<category><![CDATA[virtual function and pure virtual function]]></category>
		<category><![CDATA[Virtual Function in C++]]></category>
		<category><![CDATA[virtual function in c++ with example]]></category>
		<category><![CDATA[What is a virtual class]]></category>
		<category><![CDATA[What is a virtual class in C++]]></category>
		<category><![CDATA[What is virtual function in C]]></category>
		<category><![CDATA[why we need pure virtual function in c++]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<category><![CDATA[Wipro interview questions and answers]]></category>
		<category><![CDATA[Yash Technologies interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=380</guid>

					<description><![CDATA[Answer : A. Pure virtual function]]></description>
										<content:encoded><![CDATA[<h3 id="a-virtual-function-that-has-no-definition-within-the-base-class-is-called" class="color-pink" style="text-align: justify;">A virtual function that has no definition within the base class is called ?</h3>
<div class="row" style="text-align: justify;">
<div class="col-sm-6">
<p>A. Pure virtual function</p>
</div>
<div class="col-sm-6">
<p>B. Pure static function</p>
</div>
<div class="col-sm-6">
<p>C. Pure Const function</p>
</div>
<div class="col-sm-6">
<p>D. Virtual Function</p>
</div>
</div>
<p style="text-align: justify;"><b>Answer : </b>A. <a href="https://www.wikitechy.com/interview-questions/cpp/what-is-pure-virtual-function-in-cpp/" target="_blank" rel="noopener">Pure virtual function</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/cpp/a-virtual-function-that-has-no-definition-within-the-base-class-is-called/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Which of the following statements about virtual base classes is correct ?</title>
		<link>https://www.wikitechy.com/interview-questions/cpp/which-of-the-following-statements-about-virtual-base-classes-is-correct/</link>
					<comments>https://www.wikitechy.com/interview-questions/cpp/which-of-the-following-statements-about-virtual-base-classes-is-correct/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Mon, 12 Jul 2021 22:41:41 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[BMC Software interview questions and answers]]></category>
		<category><![CDATA[Bosch India Software interview questions and answers]]></category>
		<category><![CDATA[C++ Virtual Base Class]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[eInfochips interview questions and answers]]></category>
		<category><![CDATA[Electronics Arts Inc interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[Harman International interview questions and answers]]></category>
		<category><![CDATA[how virtual base class works in c++]]></category>
		<category><![CDATA[In C++ what is a virtual base class?]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Larsen & Toubro interview questions and answers]]></category>
		<category><![CDATA[Mathworks India Private Limited interview questions and answers]]></category>
		<category><![CDATA[Mavenir interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Philips Software Centre Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Sapient Technical and HR Interview Questions]]></category>
		<category><![CDATA[significance of virtual base class]]></category>
		<category><![CDATA[SRM Technologies interview questions and answers]]></category>
		<category><![CDATA[Symphony Teleca interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[Tecnotree interview questions and answers]]></category>
		<category><![CDATA[virtual base class]]></category>
		<category><![CDATA[virtual base class in c++]]></category>
		<category><![CDATA[virtual base class in c++ with example program]]></category>
		<category><![CDATA[Virtual base classes]]></category>
		<category><![CDATA[Virtual class]]></category>
		<category><![CDATA[virtual class in c++]]></category>
		<category><![CDATA[Virtual Function in C++]]></category>
		<category><![CDATA[what is a virtual base class?]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<category><![CDATA[Wipro interview questions and answers]]></category>
		<category><![CDATA[Yash Technologies interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=378</guid>

					<description><![CDATA[Answer : B. It is used to avoid multiple copies of base class in derived class.]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h3 id="which-of-the-following-statements-about-virtual-base-classes-is-correct" class="color-pink" style="text-align: justify;">Which of the following statements about virtual base classes is correct ?</h3>
<div class="row" style="text-align: justify;">
<div class="col-sm-12">
<p>A. It is used to provide multiple inheritance .</p>
</div>
<div class="col-sm-12">
<p>B. It is used to avoid multiple copies of base class in derived class .</p>
</div>
<div class="col-sm-12">
<p>C. It is used to allow multiple copies of base class in a derived class.</p>
</div>
<div class="col-sm-12">
<p>D. It allows private members of the base class to be inherited in the derived class.</p>
</div>
</div>
</div>
</div>
<h3 id="answer-b-it-is-used-to-avoid-multiple-copies-of-base-class-in-derived-class" style="text-align: justify;"><b>Answer : </b>B. It is used to avoid multiple copies of base class in derived class .</h3>
<div class="subheading" style="text-align: justify;">
<h2 id="explanation">Explanation</h2>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>When two or more objects are derived from a common base class, we can prevent multiple copies of the base class being present in an object derived from those objects by declaring the base class as virtual when it is being inherited such a base class is known as virtual base class.</li>
<li>Virtual base classes, used in virtual inheritance, is a way of preventing multiple &#8220;instances&#8221; of a given class appearing in an inheritance hierarchy when using multiple inheritance.</li>
</ul>
</div>
</div>
<div class="ImageContent">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/cpp/virtual-base-class-in-cpp.png" alt=" Virtual Base Class" /></div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/cpp/which-of-the-following-statements-about-virtual-base-classes-is-correct/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
