<?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>private member function in c++ with example - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/private-member-function-in-c-with-example/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/private-member-function-in-c-with-example/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Tue, 14 Sep 2021 05:11:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>private member function in c++ with example - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/private-member-function-in-c-with-example/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Which of the following can access private data members or member functions of a class ?</title>
		<link>https://www.wikitechy.com/interview-questions/cpp/which-of-the-following-can-access-private-data-members-or-member-functions-of-a-class/</link>
					<comments>https://www.wikitechy.com/interview-questions/cpp/which-of-the-following-can-access-private-data-members-or-member-functions-of-a-class/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Mon, 12 Jul 2021 22:32:20 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[accessing class members in c++]]></category>
		<category><![CDATA[Accessing private members of C++ classes]]></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++ How does a function access private data member of a class]]></category>
		<category><![CDATA[Can friend functions access private members]]></category>
		<category><![CDATA[Can member functions access private variables]]></category>
		<category><![CDATA[Can objects access private members in C++]]></category>
		<category><![CDATA[Can we access private members without using its object]]></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 can we access private member (functions) of class]]></category>
		<category><![CDATA[how to access private data members of a class in c++]]></category>
		<category><![CDATA[How to access private data members outside the class]]></category>
		<category><![CDATA[How to access private data members outside the class without]]></category>
		<category><![CDATA[how to access private member function of a class in c++]]></category>
		<category><![CDATA[how to access private member variables of a class in c++]]></category>
		<category><![CDATA[How to access private variables from another class]]></category>
		<category><![CDATA[how to call private member function of a class in c++ program]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Is it possible to access data members outside a class]]></category>
		<category><![CDATA[is there any way to access class private members without its object]]></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[private member function in c++ with example]]></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[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=374</guid>

					<description><![CDATA[Answer : C. Any member function of that class.]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h3 id="which-of-the-following-can-access-private-data-members-or-member-functions-of-a-class" class="color-pink" style="text-align: justify;">Which of the following can access private data members or member functions of a class ?</h3>
<div class="row" style="text-align: justify;">
<div class="col-sm-6">
<p>A. Any function in the program.</p>
</div>
<div class="col-sm-6">
<p>B. All global functions in the program.</p>
</div>
<div class="col-sm-6">
<p>C. Any member function of that class.</p>
</div>
<div class="col-sm-6">
<p>D. Only public member functions of that class.</p>
</div>
</div>
</div>
</div>
<h3 id="answer-c-any-member-function-of-that-class" style="text-align: justify;"><b>Answer : </b>C. Any member function of that class.</h3>
<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;">Accessing a data member depends only on the access control of that data member. If its public, then the data member can be easily accessed using the direct member access (.) operator with the object of that class.</li>
<li style="text-align: justify;">If, the data member is defined as private or protected, then we cannot access the data variables directly. Then we will have to create special public member functions to access, use or initialize the private and protected data members.</li>
<li style="text-align: justify;">These member functions are also called Accessors and Mutator methods or getter and setter functions.</li>
</ul>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/cpp/which-of-the-following-can-access-private-data-members-or-member-functions-of-a-class/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Which of the following access specifiers is used in a class definition by default ?</title>
		<link>https://www.wikitechy.com/interview-questions/cpp/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default/</link>
					<comments>https://www.wikitechy.com/interview-questions/cpp/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Mon, 12 Jul 2021 22:28:07 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[access specifier in c++]]></category>
		<category><![CDATA[access specifiers in c++ inheritance]]></category>
		<category><![CDATA[access specifiers in c++ with example programaccess specifiers in c++]]></category>
		<category><![CDATA[access specifiers in c++ with examples]]></category>
		<category><![CDATA[access specifiers in oops with example]]></category>
		<category><![CDATA[access specifiers is used in a class definition by default 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++ protected inheritance]]></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[default access specifier in c++]]></category>
		<category><![CDATA[default access specifiers in c++]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[difference between public private and protected in c++ with example]]></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[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[private member function in c++ with example]]></category>
		<category><![CDATA[protected in c++ with example]]></category>
		<category><![CDATA[public private protected c++]]></category>
		<category><![CDATA[public private protected inheritance 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[what is correct about the static data member of a class?]]></category>
		<category><![CDATA[which access specifier is implicitly used in a class]]></category>
		<category><![CDATA[which access specifiers is used in a class definition by default]]></category>
		<category><![CDATA[which of the following provides a reuse mechanism?]]></category>
		<category><![CDATA[which of these is a function defined in a 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=372</guid>

					<description><![CDATA[Answer : C. Private]]></description>
										<content:encoded><![CDATA[<div class="row">
<div class="col-sm-12">
<div class="TextHeading">
<div class="hddn">
<h4 id="which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default" class="color-pink" style="text-align: justify;">Which of the following access specifiers is used in a class definition by default ?</h4>
<div class="row" style="text-align: justify;">
<div class="col-sm-6">
<p>A. Protected</p>
</div>
<div class="col-sm-6">
<p>B. Public</p>
</div>
<div class="col-sm-6">
<p>C. Private</p>
</div>
<div class="col-sm-6">
<p>D. Friend</p>
</div>
</div>
</div>
</div>
<h3 id="answer-c-private" style="text-align: justify;"><b>Answer : </b>C. Private</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><b>Public</b> – The members declared as Public are accessible from outside the Class through an object of the class.</li>
<li><b>Protected</b> – The members declared as Protected are accessible from outside the class but only in a class derived from it.</li>
<li><b>Private</b> – These members are only accessible from within the class. No outside Access is allowed.</li>
<li><b>Friend</b> – A friend function of a class is defined outside that class scope but it has the right to access all private and protected members of the class.</li>
</ul>
</div>
</div>
<div class="text-center row" style="text-align: justify;"></div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/cpp/which-of-the-following-access-specifiers-is-used-in-a-class-definition-by-default/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
