0

I have a piece of software in which there is a function ie:

void function_name(structure_t *param1, void *param2){code....}

I am trying to create a function prototype for this function so it can be linked to another function that occurs before it. I have tried the below line with no success, it does not want to compile.

void function_name(structure_t, void);

I have this line below the associated structure but my guess is the problem is related to the void. The function itself takes the void *param2, which to be honest, confuses me but it works.

The compiler gives the error message: "'void' must be the only parameter"

1
  • What language are you working in? Commented Dec 2, 2011 at 6:33

1 Answer 1

1

The Function declaration is missing the * to define the arguments as pointers!

void function_name(structure_t *, void *);
Sign up to request clarification or add additional context in comments.

2 Comments

thanks, that did resolve the problem with the function prototype but now it is saying that the two types do not match. I typed them exactly as they are in the code, any idea what could be wrong?
would really need the code for that... but my guess would be that it's not using the same structure_t in the declaration as in the definition.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.