//Pointer to structure
#include<stdio.h>
#include<string.h>
struct student
{
char name[20];
int rollno;
float marks;
}s1,*sp;
int main()
{
sp=&s1;
strcpy(s1.name,"ABCD");
s1.rollno=1;
s1.marks=78.88;
printf("Name=%s\nRollNo=%d\nMarks=%f",s1.name,
s1.rollno,s1.marks);
printf("\n");
printf("\n");
printf("Output through pointer----->\n");
printf("%s\n",(*sp).name);
printf("%d\n",(*sp).rollno);
printf("%f\n",(*sp).marks);
printf("\n");
printf("Output through arrow operator----->");
printf("%s\n",sp->name);
printf("%d\n",sp->rollno);
printf("%f\n",sp->marks);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: