<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: C++ Friend function and Friend class</title>
	<atom:link href="http://www.codingunit.com/cplusplus-tutorial-friend-function-and-friend-class/feed" rel="self" type="application/rss+xml" />
	<link>http://www.codingunit.com/cplusplus-tutorial-friend-function-and-friend-class</link>
	<description>CodingUnit is your online resource for learning to program. Tutorials on C, C++, PHP, Python, MySQL, Java, JQuery, Opengl, DirectX and much more!</description>
	<lastBuildDate>Mon, 06 Feb 2012 06:08:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: SHAGUN</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-friend-function-and-friend-class/comment-page-1#comment-4426</link>
		<dc:creator>SHAGUN</dc:creator>
		<pubDate>Tue, 17 Jan 2012 11:21:04 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=535#comment-4426</guid>
		<description>worth!!!!!!!!!!!</description>
		<content:encoded><![CDATA[<p>worth!!!!!!!!!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tek</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-friend-function-and-friend-class/comment-page-1#comment-4323</link>
		<dc:creator>tek</dc:creator>
		<pubDate>Fri, 02 Dec 2011 02:09:49 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=535#comment-4323</guid>
		<description>C++ :Can we access private function of class from another class(not friend or inherited) without using public function?I mean Class A has private function A1.Can we access A1 from another class B directly using pointer.You cannot use public function in class A to return address of private function A1.class B is not friend or child of class A.
-Tek</description>
		<content:encoded><![CDATA[<p>C++ :Can we access private function of class from another class(not friend or inherited) without using public function?I mean Class A has private function A1.Can we access A1 from another class B directly using pointer.You cannot use public function in class A to return address of private function A1.class B is not friend or child of class A.<br />
-Tek</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: veena bopche</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-friend-function-and-friend-class/comment-page-1#comment-4116</link>
		<dc:creator>veena bopche</dc:creator>
		<pubDate>Wed, 09 Nov 2011 05:47:41 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=535#comment-4116</guid>
		<description>can we make more than one friend functions within a class?</description>
		<content:encoded><![CDATA[<p>can we make more than one friend functions within a class?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yash Bawne</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-friend-function-and-friend-class/comment-page-1#comment-3789</link>
		<dc:creator>Yash Bawne</dc:creator>
		<pubDate>Sat, 24 Sep 2011 18:11:34 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=535#comment-3789</guid>
		<description>We consider that friend function access the private data member of the class.But I did&#039;nt get actually ,because member function of the class also use private data directly.
Plese clarify that...</description>
		<content:encoded><![CDATA[<p>We consider that friend function access the private data member of the class.But I did&#8217;nt get actually ,because member function of the class also use private data directly.<br />
Plese clarify that&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: silu</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-friend-function-and-friend-class/comment-page-1#comment-3532</link>
		<dc:creator>silu</dc:creator>
		<pubDate>Mon, 13 Jun 2011 18:35:42 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=535#comment-3532</guid>
		<description>friend function can access the private members of class. Is it possible, so that friend function should not access the private members of a class? Is any concept deals with it.</description>
		<content:encoded><![CDATA[<p>friend function can access the private members of class. Is it possible, so that friend function should not access the private members of a class? Is any concept deals with it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hemed</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-friend-function-and-friend-class/comment-page-1#comment-3423</link>
		<dc:creator>hemed</dc:creator>
		<pubDate>Wed, 18 May 2011 13:10:45 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=535#comment-3423</guid>
		<description>why the argument or parameter  of a friend function must be of the type of Aclass
eg from the code above
 // Declare the two functions friends.
friend int add(AClass input);
friend int minus(AClass input);

am confused with this please help me</description>
		<content:encoded><![CDATA[<p>why the argument or parameter  of a friend function must be of the type of Aclass<br />
eg from the code above<br />
 // Declare the two functions friends.<br />
friend int add(AClass input);<br />
friend int minus(AClass input);</p>
<p>am confused with this please help me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shrihari</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-friend-function-and-friend-class/comment-page-1#comment-1124</link>
		<dc:creator>shrihari</dc:creator>
		<pubDate>Wed, 30 Jun 2010 05:33:22 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=535#comment-1124</guid>
		<description>Thank u. It works!!</description>
		<content:encoded><![CDATA[<p>Thank u. It works!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-friend-function-and-friend-class/comment-page-1#comment-1071</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Tue, 29 Jun 2010 15:56:35 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=535#comment-1071</guid>
		<description>@shrihari  Sure you can declare two functions friend of one class, take a look at an example:

#include&lt;iostream&gt;
using namespace std;

class AClass {
	private:
		int a,b;
	public:
		void test() {
			a=10;
			b=20;
		}
		// Declare the two functions friends.
		friend int add(AClass input);
		friend int minus(AClass input);
};

// Function one
int add(AClass input) {
	return int(input.a + input.b);
}

// Function two
int minus(AClass input) {
	return int(input.b - input.a);
}

void main(void){
	AClass output;
	// Initialize output
	output.test();
	cout &lt;&lt; add(output) &lt;&lt; endl;
	cout &lt;&lt; minus(output) &lt;&lt; endl;
}

I hope this answers your question.</description>
		<content:encoded><![CDATA[<p>@shrihari  Sure you can declare two functions friend of one class, take a look at an example:</p>
<p>#include&lt;iostream&gt;<br />
using namespace std;</p>
<p>class AClass {<br />
	private:<br />
		int a,b;<br />
	public:<br />
		void test() {<br />
			a=10;<br />
			b=20;<br />
		}<br />
		// Declare the two functions friends.<br />
		friend int add(AClass input);<br />
		friend int minus(AClass input);<br />
};</p>
<p>// Function one<br />
int add(AClass input) {<br />
	return int(input.a + input.b);<br />
}</p>
<p>// Function two<br />
int minus(AClass input) {<br />
	return int(input.b &#8211; input.a);<br />
}</p>
<p>void main(void){<br />
	AClass output;<br />
	// Initialize output<br />
	output.test();<br />
	cout &lt;&lt; add(output) &lt;&lt; endl;<br />
	cout &lt;&lt; minus(output) &lt;&lt; endl;<br />
}</p>
<p>I hope this answers your question.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shrihari</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-friend-function-and-friend-class/comment-page-1#comment-1054</link>
		<dc:creator>shrihari</dc:creator>
		<pubDate>Mon, 28 Jun 2010 08:45:25 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=535#comment-1054</guid>
		<description>can two functions be declared friend to one class?</description>
		<content:encoded><![CDATA[<p>can two functions be declared friend to one class?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.codingunit.com/cplusplus-tutorial-friend-function-and-friend-class/comment-page-1#comment-891</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Mon, 15 Mar 2010 18:21:57 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/?p=535#comment-891</guid>
		<description>The tutorial is clear on this, but here you go, I found this definition on another site:

&lt;blockquote&gt;A friend function is used for accessing the non-public members of a class. A class can allow non-member functions and other classes to access its own private data, by making them friends. Thus, a friend function is an ordinary function or a member of another class. A friend class has full access of private data members of another class without being member of that class.&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>The tutorial is clear on this, but here you go, I found this definition on another site:</p>
<blockquote><p>A friend function is used for accessing the non-public members of a class. A class can allow non-member functions and other classes to access its own private data, by making them friends. Thus, a friend function is an ordinary function or a member of another class. A friend class has full access of private data members of another class without being member of that class.</p></blockquote>
]]></content:encoded>
	</item>
</channel>
</rss>

