This is a restriction/limitation/inconsistency of C and C++.
In an assignment, the left and right hand side have to have the same type. But initialization is more liberal, although looks like an assignment.
Below are two possibilities that might get you the functionality you want.
}
You said that you are programming in C. But if what you have is actually a C++ compiler then the following would also work.
}