In this tutorial you will see how pointer is used with structure. This is a very important example because all data-structure program work on this principle.
#include <stdio.h>
#include <conio.h>
struct record
{
char name[20];
int roll;
};
struct record r,*p;
void main()
{
p=&r;
clrscr();
printf("\nEnter the name\n");
scanf("\n%s",&p->name);
printf("\nEnter the roll no\n");
scanf("%d",&p->roll);
printf("\n%s",p->name);
printf("\n%d",p->roll);
}
p=&r assign the address of object to p
*p allow the pointer to access the objects
*p.roll is same as p->roll like used in example.

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.