Showing posts with label Pointers to Structure in C. Show all posts
Showing posts with label Pointers to Structure in C. Show all posts

Monday, 23 February 2015

Pointers to Structure in C


#include<stdio.h>
#include<conio.h>
struct Student
{
int eno;
char name[50];
int age;
};
main()
{
int i=0;
struct Student *s;
clrscr();

printf("\n Enter Entrollment No :");
scanf("%d",&s->eno); /* ->   -   Member Access Operator */
printf("\n Enter Your Name :");
scanf("%s",&s->name);
printf("\n Enter Your Age :");
scanf("%d",&s->age);

printf("\n Entrollment No :%d",s->eno);
printf("\n Your Name :%s",s->name);
printf("\n Your Age :%d",s->age);

getch();
}