Saturday, 5 May 2012

Basics of Struct in C


#include<stdio.h>
#include<conio.h>


main()
{
      struct date{
             int month;
             int day;
             int year;
      };
      struct account{
             int acct_no;
             char acct_type;
             char name[80];
             float balance;
             struct date lastpayment;
             }customer;
             
             printf("%d\n",sizeof customer);
             printf("%d",sizeof (struct account));
             getch();
             return 0;
}

No comments:

Post a Comment