here is my code if I hard code something it works fine. but that's not real world. I want to prompt for some values but I can't seem to get them to work. i.e. Enter your name and pass that to Asample.name
DougP
Code:
#include <stdafx.h>
#include <stdio.h>
int main( void )
{
struct sample{
char *name;
char *addr;
char *city;
char *state;
char *zip;
char *phone;
};
struct sample Asample ;
char thename;
printf("Enter Name");
scanf("%s",thename);
//Asample.name = "Fred"; < this works
Asample.name= thename; // this does not
printf("%s\n",Asample.name);
return 0; /* indicates successful termination */
} /* end main */
DougP