here is some problem in structures



lets take a look at the following code:-


#include<stdio.h>
#include<conio.h>
struct tag{

int age;
char *name;
}a;
void main()
{
clrscr();
puts("enter name ");
scanf("%s",a.name);
fflush(stdin);
puts("enter");
scanf("%d",&a.age);
printf("%s\t%d",a.name,a.age);
getch();
}

its look ok to me, but as i run this, i face some problem, i m not able
to assign value to name
but as i declare a structure's instance i.e, "a" within the main
program, i m able to assign a value in a.name.
why this is so,
plz help me i m very confused

.



Relevant Pages

  • [PATCH 2.6.19-rc1 V9] drivers: add LCD support
    ... Adds support for the ks0108 LCD Controller as a device driver. ... +The buffer should be a 128*64 unsigned char array: ... * GNU General Public License for more details. ... +static void cfag12864b_setbit ...
    (Linux-Kernel)
  • [PATCH 2.6.19-rc1 V9] drivers: add LCD support
    ... Adds support for the ks0108 LCD Controller as a device driver. ... +The buffer should be a 128*64 unsigned char array: ... * GNU General Public License for more details. ... +static void cfag12864b_setbit ...
    (Linux-Kernel)
  • Re: back once again...
    ... reference to type ... a, signed char ... int dycObjectP(dyt obj); ... void dycBeginClass; ...
    (comp.lang.misc)
  • [PATCH 2.6.18 V8] drivers: add LCD support
    ... Adds a LCD class for registering LCD devices. ... +The buffer should be a 128*64 unsigned char array: ... * GNU General Public License for more details. ... +static void cfag12864b_setbit ...
    (Linux-Kernel)
  • [PATCH 2.6.18 V7] drivers: add lcd display support
    ... Adds support for the cfag12864b LCD Display as a device driver. ... +The buffer should be a 128*64 unsigned char array: ... * GNU General Public License for more details. ... +static void cfag12864b_setbit ...
    (Linux-Kernel)