<?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: 7.8 &#8212; Function Pointers</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/78-function-pointers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/78-function-pointers/</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 12:30:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: zingmars</title>
		<link>http://www.learncpp.com/cpp-tutorial/78-function-pointers/comment-page-1/#comment-95758</link>
		<dc:creator>zingmars</dc:creator>
		<pubDate>Tue, 19 Jul 2011 11:42:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/78-function-pointers/#comment-95758</guid>
		<description>I completely agree - pointers are one of the most confusing subjects in programming imo, and it would be good if there were ways to actually use them in some sort.</description>
		<content:encoded><![CDATA[<p>I completely agree &#8211; pointers are one of the most confusing subjects in programming imo, and it would be good if there were ways to actually use them in some sort.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.learncpp.com/cpp-tutorial/78-function-pointers/comment-page-1/#comment-95715</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Sat, 16 Jul 2011 03:53:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/78-function-pointers/#comment-95715</guid>
		<description>Great tutorials Alex although all this pointer stuff is pretty confusing. I&#039;d like to see some questions at the end of some of these though. I would have a better understanding of the concepts and a memory of the syntax if I had to do some of this myself; a suggestion if you have time.</description>
		<content:encoded><![CDATA[<p>Great tutorials Alex although all this pointer stuff is pretty confusing. I&#8217;d like to see some questions at the end of some of these though. I would have a better understanding of the concepts and a memory of the syntax if I had to do some of this myself; a suggestion if you have time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SJ</title>
		<link>http://www.learncpp.com/cpp-tutorial/78-function-pointers/comment-page-1/#comment-95405</link>
		<dc:creator>SJ</dc:creator>
		<pubDate>Tue, 03 May 2011 07:08:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/78-function-pointers/#comment-95405</guid>
		<description>Hi,
Will you please explain me constant function or constant member function.
e.g.

int fun1() const;
Will you please explain me where and why we need to use this? With example.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Will you please explain me constant function or constant member function.<br />
e.g.</p>
<p>int fun1() const;<br />
Will you please explain me where and why we need to use this? With example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ellankavi</title>
		<link>http://www.learncpp.com/cpp-tutorial/78-function-pointers/comment-page-1/#comment-89194</link>
		<dc:creator>ellankavi</dc:creator>
		<pubDate>Wed, 28 Jul 2010 00:05:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/78-function-pointers/#comment-89194</guid>
		<description>Are you sure about
&lt;pre&gt;
cin &lt;&lt; input_number;
&lt;!--formatted--&gt;&lt;/pre&gt;
and not 
&lt;pre&gt;
cin &gt;&gt; input_number;
&lt;!--formatted--&gt;&lt;/pre&gt;

If not, what do you mean by the first case?</description>
		<content:encoded><![CDATA[<p>Are you sure about</p>
<pre>
cin &lt;&lt; input_number;
<!--formatted--></pre>
<p>and not </p>
<pre>
cin &gt;&gt; input_number;
<!--formatted--></pre>
<p>If not, what do you mean by the first case?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: george</title>
		<link>http://www.learncpp.com/cpp-tutorial/78-function-pointers/comment-page-1/#comment-88177</link>
		<dc:creator>george</dc:creator>
		<pubDate>Fri, 09 Jul 2010 15:33:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/78-function-pointers/#comment-88177</guid>
		<description>Is function pointer the only way to pass a function as a parameter to another function?</description>
		<content:encoded><![CDATA[<p>Is function pointer the only way to pass a function as a parameter to another function?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Srivatsan</title>
		<link>http://www.learncpp.com/cpp-tutorial/78-function-pointers/comment-page-1/#comment-88127</link>
		<dc:creator>Srivatsan</dc:creator>
		<pubDate>Thu, 08 Jul 2010 23:39:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/78-function-pointers/#comment-88127</guid>
		<description>hi Alex,

What exactly does it mean when you say the name of the function is a pointer?? A pointer to a variable, I understand, holds the address where the variable is stored. What is stored in the address that the name of the function points to?

Great tutorial. Thank you.</description>
		<content:encoded><![CDATA[<p>hi Alex,</p>
<p>What exactly does it mean when you say the name of the function is a pointer?? A pointer to a variable, I understand, holds the address where the variable is stored. What is stored in the address that the name of the function points to?</p>
<p>Great tutorial. Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blaji</title>
		<link>http://www.learncpp.com/cpp-tutorial/78-function-pointers/comment-page-1/#comment-86502</link>
		<dc:creator>Blaji</dc:creator>
		<pubDate>Tue, 15 Jun 2010 07:49:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/78-function-pointers/#comment-86502</guid>
		<description>Hi, I would like to add some more points. How do we declare a pointer to a function which returns a pointer to a function ? (function pointer  returning function pointer). Here we go.. Explained by sample code below. Hope its clear.

void foo()
{
  printf(&quot;Im foo&quot;);
}

typedef void (*retType)();

retType FuncRetFuncPtr()
{
 printf(&quot;FuncRetFuncPtr calledn&quot;);
 return foo;   //returning function pointer
}

main()
{
   retType (*fptr)() = FuncRetFuncPtr;
   void (*catchfoo)() = fptr();  //catchfoo-holds return val of FuncRetFuncPt    
                                 
   catchfoo();                   //prints &quot;im foo&quot;. for confirmation :)
}</description>
		<content:encoded><![CDATA[<p>Hi, I would like to add some more points. How do we declare a pointer to a function which returns a pointer to a function ? (function pointer  returning function pointer). Here we go.. Explained by sample code below. Hope its clear.</p>
<p>void foo()<br />
{<br />
  printf(&#8220;Im foo&#8221;);<br />
}</p>
<p>typedef void (*retType)();</p>
<p>retType FuncRetFuncPtr()<br />
{<br />
 printf(&#8220;FuncRetFuncPtr calledn&#8221;);<br />
 return foo;   //returning function pointer<br />
}</p>
<p>main()<br />
{<br />
   retType (*fptr)() = FuncRetFuncPtr;<br />
   void (*catchfoo)() = fptr();  //catchfoo-holds return val of FuncRetFuncPt    </p>
<p>   catchfoo();                   //prints &#8220;im foo&#8221;. for confirmation :)<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://www.learncpp.com/cpp-tutorial/78-function-pointers/comment-page-1/#comment-85599</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Sun, 30 May 2010 05:24:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/78-function-pointers/#comment-85599</guid>
		<description>Hi, could someone help me with program problem ? 
I have code 

&lt;pre&gt;

while(1)  {
    cout &lt;&lt; &quot;Write string: &quot; ;
    getline(cin,input_string);
    cout &lt;&lt; &quot;Write number: &quot;;
    cin &lt;&lt; input_number;
...
}
&lt;/pre&gt;
Program should get input from user and make some actions, and then want  again new input and again and again...In first loop everything works good, but in the second loop getline() dont read string, i get output:

&lt;pre&gt;
Write string: Write number : 
&lt;/pre&gt;
cin wants me to enter number , but getline was skipped, do u know why ?</description>
		<content:encoded><![CDATA[<p>Hi, could someone help me with program problem ?<br />
I have code </p>
<pre>

while(1)  {
    cout &lt;&lt; &quot;Write string: &quot; ;
    getline(cin,input_string);
    cout &lt;&lt; &quot;Write number: &quot;;
    cin &lt;&lt; input_number;
...
}
</pre>
<p>Program should get input from user and make some actions, and then want  again new input and again and again&#8230;In first loop everything works good, but in the second loop getline() dont read string, i get output:</p>
<pre>
Write string: Write number :
</pre>
<p>cin wants me to enter number , but getline was skipped, do u know why ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Murka</title>
		<link>http://www.learncpp.com/cpp-tutorial/78-function-pointers/comment-page-1/#comment-84367</link>
		<dc:creator>Murka</dc:creator>
		<pubDate>Sun, 09 May 2010 16:34:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/78-function-pointers/#comment-84367</guid>
		<description>Member functions are sometimes a pain to use, but typedefs make even such fugly syntax readable.

Example:
&lt;pre&gt;
typedef std::string (playerInfo::*memfuncptr)(); 
//Function prototype
memfuncptr strToMfptr(std::string &amp;strInput);
&lt;!--formatted--&gt;&lt;/pre&gt;

So remember, typedefs are your friend. I still haven&#039;t found out how to write the above without one, but am interested how it would look.</description>
		<content:encoded><![CDATA[<p>Member functions are sometimes a pain to use, but typedefs make even such fugly syntax readable.</p>
<p>Example:</p>
<pre>
typedef std::string (playerInfo::*memfuncptr)();
//Function prototype
memfuncptr strToMfptr(std::string &amp;strInput);
<!--formatted--></pre>
<p>So remember, typedefs are your friend. I still haven&#8217;t found out how to write the above without one, but am interested how it would look.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atul</title>
		<link>http://www.learncpp.com/cpp-tutorial/78-function-pointers/comment-page-1/#comment-79728</link>
		<dc:creator>Atul</dc:creator>
		<pubDate>Fri, 05 Mar 2010 01:23:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/cpp-tutorial/78-function-pointers/#comment-79728</guid>
		<description>awsome post..i love it.. :)</description>
		<content:encoded><![CDATA[<p>awsome post..i love it.. :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

