Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6831685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:45:59+00:00 2026-05-26T22:45:59+00:00

This code is working fine in c++.I need the solution for C. This is

  • 0

This code is working fine in c++.I need the solution for C.

This is my sample.

 FileName:Mail.c

This is the declaration I made in the file mail.c

 #ifdef __cplusplus
   typedef int (__cdecl *SetIpAddressFun)(char* , int  , int );
   typedef bool (__cdecl *SendMailFun)(char * , char *);
 #endif

I used this function pointers in the function called func() in the same file mail.c

 void func()
 {
     SendMailFun sendMailFuncPtr;
     SetIpAddressFun setIpAddressFuncPtr;
 }

EDIT

If i remove the #ifdef lines in the file mail.c then it is showing the following error.

 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

ERROR

List of errors happened while compiling in c.

  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 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:46:00+00:00Added an answer on May 26, 2026 at 10:46 pm

    This is because when you declared the function

    #ifdef __cplusplus
       typedef int (__cdecl *SetIpAddressFun)(char* , int  , int );
       typedef bool (__cdecl *SendMailFun)(char * , char *);
     #endif
    

    you do it conditionally only for __cplusplus which is typically not defined when compiling C files

    EDIT

    I think your second problem is to do with the presence of bool which to my knowledge is not C keyword. Considering replacing it with an int

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So basically this code was working fine before. I had some computer issues and
This is really strange but this code is working fine unless the value entered
Hi Javascript gurus, I have this Javascript code which is working fine on Firefox
$(#maincontent).animate({top:450px},1200) .html($(#+Lidentity).html()) .animate({top:0px},1000); Hi friends, This is jquery code, which is working fine. As
I have this code working in C#: var request = (HttpWebRequest)WebRequest.Create(https://x.com/service); request.Method = GET;
Simple question, how make this code working ? public class T { public static
The other day this code was working. I changed some things and re-ran it
runat=server /> But this code is not working How can I add multiple controls
I'm trying to get this piece of code working a little better. I suspect
i am new in programming under linux and trying to get working this code:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.