Man look:
Then Ive compiled with:Code:/*As I'm in GREAT MOOD I will code a bit for ya*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
char *foo;
/*PAY ATTENTION*/
char bar[] = "bar";
char quux[20];
char *zyz;
foo = bar;
printf("Gimme input to quux :");
scanf("%s",quux);
printf("%s\n",foo);
zyz = quux;
printf("%s\n",zyz);
strcpy(quux,foo);
printf("%s\n",quux);
return 0;
}
gcc -W -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Wdisabled-optimization -Wendif-labels -Wfloat-equal -Wformat-literal -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-unused-parameter -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef -Wwrite-strings -pedantic learn.c -o learn
No warnings.
I have your code doing the right thing but we want you to succed, you can't use an array as left value in C. So you need something like strcpy to read the names to the struct.
Hope it helps. Also I humbly recommend you to read http://pw1.netcom.com/~tjensen/ptr/pointers.htm .