<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>typedef with a member &amp;quot;pointer to itself&amp;quot;</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/28665/typedef-with-a-member-pointer-to-itself</link><description> 
Hello forum 

 
I&amp;#39;ve a c progamming question: 
I want to place a function pointer into a typedef with a function
parameter &amp;quot;pointer to the typedef itself&amp;quot;: 

 

typedef struct pExampleStructTypdef {
 char x;
 void *y;
 int z;
 int (*pFuncPtr)(pExampleStructTypdef</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: typedef with a member "pointer to itself"</title><link>https://community.arm.com/thread/79774?ContentTypeID=1</link><pubDate>Mon, 21 Nov 2011 05:47:58 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:52b4ca22-445b-4722-b44d-5413b532bd97</guid><dc:creator>R K</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks for the answer.&lt;br /&gt;
You are correct with your objection of using typedef... I will try
it&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: typedef with a member "pointer to itself"</title><link>https://community.arm.com/thread/60094?ContentTypeID=1</link><pubDate>Mon, 21 Nov 2011 05:29:21 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:98b58a0d-a277-4df9-8903-14511ea1202c</guid><dc:creator>Mike Kleshov</dc:creator><description>&lt;p&gt;&lt;p&gt;
Slightly modified, it works:&lt;/p&gt;

&lt;pre&gt;
struct ExampleStruct {
  char  x;
  void  *y;
  int   z;
  int   (*pFuncPtr)(struct ExampleStruct *, unsigned int);
};
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
I never understood the desire to get rid of &lt;b&gt;struct&lt;/b&gt; using
&lt;b&gt;typedef&lt;/b&gt;. If your code becomes too long with &lt;b&gt;struct&lt;/b&gt;, the
problem is with the code, not with &lt;b&gt;struct&lt;/b&gt;.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>