Possible to initialize/assign a struct pointer?
问题 Let's say I have the following struct and two versions to initialize it: #include <stdio.h> typedef struct Car *CarPtr; typedef struct Car { const char* name; unsigned int price; } Car; int main(void) { Car ford = { .name = "Ford F-150", .price = 25000 }; print_struct(&ford); // is this possible to do in a single assignment? CarPtr jeep = { .name = "Jeep", .price = 40000 }; print_struct(jeep); } Is the second version possible to do directly? Or do I need to do something along the lines of: