好的,我有一个结构
typedef struct contact {
char firstName[32];
char lastName[32];
char address[100];
char city[32];
char state[32];
char zipcode[10];
} Contact;
我需要使 firstName 的值等于“Herp”
我试过这样的事情:
int main(void) {
Contact contact;
contact.firstName = "Herp"; // I also tried the following line of code:
contact.firstName[] = "Herp"; // This doesn't work, and when I add a 0 to where the array needs to point, I get a syntax error.
}
任何帮助都会很棒。