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

  • SEARCH
  • Home
  • 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 8048619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:29:59+00:00 2026-06-05T06:29:59+00:00

i defined my Function pointer with a typedef like typedef void (*ThreadFunc)( void *);

  • 0

i defined my Function pointer with a typedef like

typedef void (*ThreadFunc)( void *);

my Class member method looks like :

 void start( ThreadFunc f, vector<void *> &jobs)

in my main program i wrote a function like :

 ThreadFunc runner( void *job )
 {
  printf("->> %p\n", job);
 };

and want to run the member function
so i tried:

r.start( runner, jobs);

the compiler says:

main.cc:27: Fehler: ungültige Umwandlung von »void (* (*)(void*))(void*)« in »void (*)(void*)«
main.cc:27: Fehler:   Argument 1 von »void Thread::start(void (*)(void*), std::vector<void*, std::allocator<void*> >&)« wird initialisiert

Hope someone could help me short 🙂 greetz

  • 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-06-05T06:30:01+00:00Added an answer on June 5, 2026 at 6:30 am

    runner needs to be declared returning void, not returning ThreadFunc to match the signature for start.

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

Sidebar

Related Questions

I have a function pointer defined by: typedef void (*EventFunction)(int nEvent); Is there a
I have this user defined function. public partial class UserDefinedFunctions { static int i;
Given a function, I'd like to know whether it's a developer-defined function or a
I am trying to store a pointer to a member function in a structure
I have a base class, Parameter, and two derived classes: Scalar & Vector. In
I have a class defined like this: template< class TBoundingBox > class BoundingBoxPlaneCalculator {
i have a priority queue and i have defined like this: priority_queue<Node*,vector<Node*>,greater<Node*>> myQueue; i
I have one base class which holds a map for function pointers like this
In Go, if I define a function with pointer as the receiver, shouldn't it
I need an array to hold member-function-pointers of different classes. How can I define

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.