I have the following code
struct A { }
typedef struct A *B;
At this point, I want to declare a function which takes a const B
. In other words, I want to create a function
void funct(const struct A *val);
However when I do
const B b1 = ...;
my compiler claims it evaluates to
struct A *const b1 = ...;
I want declare a variable of data type B
such that it evaluates to either
const struct A *b1;
// or
const struct A *const b1;
How can this be done? Why does the typedef evaluate to something I don't expect?