1

I came across this struct declaration and I do not now what is the last pointer doing here?

typedef const struct { //Ommiting the members for stackoverflow!!! } PWMnCurrFdbkParams_t, *pPWMnCurrFdbkParams_t; 

So the question is

  • what is the effect of , here?
  • what is type of*pPWMnCurrFdbkParams_t
  • what usecase there is to it?
1

1 Answer 1

2

This is quite common, for example Microsoft use it a lot in their header files.

There are two types (comma separated) defined here, PWMnCurrFdbkParams_t is of type const struct and pPWMnCurrFdbkParams_t is a pointer to that const struct.

The * is not part of the name, just as int *x is where x is a pointer to an int.

Use case is almost any collection of structures, like a linked list or tree.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.