阅读背景:

在指向结构的指针数组中填充字符串

来源:互联网 

I'm reviewing pointers in C and am creating some practice exercises for myself. I thought it would be good to read in some structs via an array of struct pointers, then display and sort the array. The problem I'm having is, I feel, rather basic. The below code reads in the first entry, however the firstName string is always null. After printing the first struct and continuing the second it goes 'boom' at the time to read into the firstName string. I thought I initialized the char strings correctly in initParty(), so I'm not sure what the problem is here. Any ideas? I'm reviewing pointers in C and am creating som




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: