#include <stdio.h>
#include<string.h>
//user defined
struct student{
    int roll;
    float cgpa;
    char name[100];   };
int main() {
    struct student s2 = {1665,9.3,"Aman"}; // initializing a structure
    printf("Student roll : %d\n",s2.roll);
    
    struct student *ptr = &s2;
    printf("Student roll using pointer : %d",(*ptr).roll); 
    //priting using ptr.roll
    
    printf("\nStudent roll using arrow & pointer : %d",ptr->roll);
    //printing using ptr->roll
    printf("\nStudent name using arrow & pointer : %s",ptr->name);
    printf("\nStudent cgpa using arrow & pointer : %f",ptr->cgpa);
    
    return 0;
    
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: