I'm new to C world, and I have two probably stupid questions.
I read about structures in C, and this is where I am stuck. Let them say that we have a structure like this
typedef structs {
char model[50];
int yearOfManufacture;
int price;
} Car;
Car Ford;
Ford.yearOfManufacture = 1997;
Ford.price = 3000;
Ford.model = "Focus"
How to transfer text to Ford.model in this case?
My second question also concerns strings. This code works great
char model[50] = "Focus";
printf("Model is %s", model);
But it is not
char model[50];
model = "Focus";
Can anyone explain why it is not working?
jingo source
share