Sign in to follow this  

Does this function pointer make sense?

Recommended Posts

I've been trying to get this right but I am having a lot of trouble: double (*inputFunc)((list<double>) &); this is suppose to be a function pointer to a function that might look like:
double haha(list<double> &x)
  // do stuff to x
  return 0.0;

Is this correct? The compiler disagrees with me, but I don't know what I should do to correct it(and I have not had too much exposure to function pointers).

Share this post

Link to post
Share on other sites
Original post by Programmer One
Original post by Sagar_Indurkhya
double (*inputFunc)((list<double>) &);

Well thar's yar problem. You forgot yar typedef.

typedef double (*inputFunc)((list<double>) &);

Shouldn't it be:
typedef double (*inputFunc)(list<double>&);

Without the extra parentheses?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this