Passing Structure Variable To Function

#include<stdio.h>
#include<string.h>
struct anik
{
    char name[100];
    char id[20];
    int age;
};

rob(struct anik S)
{
    printf("Name : %s\n", S.name);
    printf("ID : %s\n", S.id);
    printf("Age : %d\n", S.age);
}

int main()
{
    struct anik std;

    strcpy(std.name, "Aubdur Rob Anik");
    strcpy(std.id, "18101073");
    std.age = 25;

    rob(std);

    return 0;
}

Comments