title: How to Eradicate this error in C Program?
body: <p>This code is working fine in c++.I need the solution for C.</p>
  
  <p>This is my sample.</p>
  
  <pre><code> FileName:Mail.c
  </code></pre>
  
  <p>This is the declaration I made in the file mail.c</p>
  
  <pre><code> #ifdef __cplusplus
     typedef int (__cdecl *SetIpAddressFun)(char* , int  , int );
     typedef bool (__cdecl *SendMailFun)(char * , char *);
   #endif
  </code></pre>
  
  <p>I used this function pointers in the function called func() in the same file mail.c</p>
  
  <pre><code> void func()
   {
       SendMailFun sendMailFuncPtr;
       SetIpAddressFun setIpAddressFuncPtr;
   }
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>If i remove the #ifdef lines in the file mail.c then it is showing the following error.</p>
  
  <pre><code> error C2143: syntax error : missing ')' before '__cdecl'
   e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(138) : error C2143: syntax error : missing '{' before '__cdecl'
   e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(138) : error C2059: syntax error : ')'
   e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(138) : error C2165: 'left-side modifier' : cannot modify pointers to data
  </code></pre>
  
  <p><strong>ERROR</strong></p>
  
  <p>List  of errors happened while compiling in c.</p>
  
  <pre><code>  e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(1615) : error   C2065: 'SendMailFun' : undeclared identifier
  
    e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(1615) : error C2146: syntax error : missing ';' before identifier 'sendMailFuncPtr'
  
    e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(1615) : error C2065: 'sendMailFuncPtr' : undeclared identifier
    e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(1616) : error C2065: 'SetIpAddressFun' : undeclared identifier
    e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(1616) : error C2146: syntax error : missing ';' before identifier 'setIpAddressFuncPtr'
    e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(1616) : error C2065: 'setIpAddressFuncPtr' : undeclared identifier
     e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(1625) : error C2065: 'setIpAddressFuncPtr' : undeclared identifier
     e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(1625) : error C2065: 'SetIpAddressFun' : undeclared identifier
     e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(1625) : error C2146: syntax error : missing ';' before identifier 'GetProcAddress'
      e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(1626) : error C2065: 'setIpAddressFuncPtr' : undeclared identifier
      e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(1626) : warning C4047: '!=' : 'void *' differs in levels of indirection from 'int'
      e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(1628) : warning C4013: 'setIpAddressFuncPtr' undefined; assuming extern returning int
      e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(1630) : error C2065: 'sendMailFuncPtr' : undeclared identifier
      e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(1630) : error C2065: 'SendMailFun' : undeclared identifier
      e:\projects\avg\apps\ezcepanel i.7 - pcpanel from vss\ccode\alarms.c(1630) : error C2146: syntax error : missing ';' before identifier 
  </code></pre>