【C++ 小问答】5:对结构体成员字符数组的访问
问 1struct Book { 2 char name[10]; 3 char type[10]; 4 int price; 5}; 6 7struct Book *getBook() 8{ 9 struct Book b = { 10 .name = "C Primer", 11 .type = "Programme", 12 .price = 100, 13 }; 14 return &b; 15}; 16 17int main() 18{ 19 struct Book *b = getBook(); 20 char *name = b->name; 21 char *type = …