Program to Input value in structure using pointer

#include<stdio.h>
#include<conio.h>
 struct stu
 {
 int roll;
 char name[30];
  }*k;
   void main()
   {
   clrscr();
   printf("\n enter roll:");
   scanf("%d",&k->roll);
   printf("\n enter name:");
   scanf("%s",&k->name);
   printf("\n=%d",k->roll);
   printf("\n=%s",k->name);
   getch();
 }

Leave a Reply