0

I have the following code:

    interface ** rInterfaces[MAX_REACTANS];
    _reaction->rInterfaces = (interface **)malloc(MAX_REACTANS * sizeof(interface *));

I am getting an error saying:

error: incompatible types when assigning to type ‘struct interface **[10]’ from type ‘struct interface **’

I don't know why I am getting this. Any help would be appreciated.

1
  • What is _reaction? What is _reaction->rInterfaces? Commented Feb 23, 2012 at 23:12

1 Answer 1

3

Judging by your malloc you want a pointer to a pointer to an interface. Drop [MAX_REACTANS] from your declaration. You can also drop the interface ** cast.

Sign up to request clarification or add additional context in comments.

Comments

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.