simple answer: your copying the adress and not the string itself. For that you use the strcpy function found in string.h
Code:
#include<stdio.h>
#include <string.h>
struct example
{
char name[10];
int year;
};
int main(void)
{
struct example x;
char fname[10] = "John";
int number = 1930;
strcpy(x.name, fname);
x.year = number;
puts(x.name);
printf("%d", x.year);
//getchar();
return 0;
}
You might want to take a look at the following links. If you are on structures already you should be familar with the string capabilities of C and its nuances.
some links