Why is it ok to cast to an undeclared struct pointer in C?
BackAnswers (3)
The appearance of struct test* is an implicit declaration of struct test. Specifically, struct test declares the type. Because the struct type is declared a pointer to that type is valid. Even though the struct type was not fully defined, the representation of the pointer type is known since a pointer to any struct type has the same representation as described in section 6.2.5p33 of the C standard:
2
Saksham Agrawal
•
5/27/2025, 3:46:16 AM
any suggestions on it ?
1
Saksham Agrawal
•
5/27/2025, 5:16:06 PM
him
0
Saksham Agrawal
•
10/10/2025, 9:42:32 AM