pointer inside structure in c code example
Example: pointer inside structure in c
#include<stdio.h>
struct Student
{
int *ptr; //Stores address of integer Variable
char *name; //Stores address of Character String
}s1;
int main()
{
int roll = 20;
s1.ptr = &roll;
s1.name = "Pritesh";
printf("\nRoll Number of Student : %d",*s1.ptr);
printf("\nName of Student : %s",s1.name);
return(0);
}