Hi!
I tried to find out what a struct really 'is' and hit a problem, so I have really 2 questions:
1) What is saved in 'sara'? Is it a pointer to the first element of the struct?
2) The more interesting question: Why doesn't it compile? GCC says "test.c:10: error: incompatible types in assignment" and I can't figure out why... (This part has been solved by your answers already, great!)
#include <stdio.h>
struct name {
char first[20];
char last[20];
};
int main() {
struct name sara;
sara.first = "Sara";
sara.last = "Black";
printf("struct direct: %x\n",sara);
printf("struct deref: %x\t%s\n", *sara, *sara);
}
Thanks for your help!