initial import
[staff/goc4/2018bti7061.git] / c-5-structuresFiles / examples / c-structures / structures1.c
1 #include <stdio.h>
2
3 struct account {
4 int acct_no;
5 char acct_type;
6 char name[80];
7 float balance;
8 } myAccount1; /* define a variable myAccount1 from type struct account */
9
10 int main(){
11 printf("Structures, example1\n");
12
13 /* define a variable myAccount2 of type struct account */
14 struct account myAccount2;
15
16 /* Define an array containing 100 struct accounts */
17 struct account myAccountArray[100];
18
19 myAccount1.acct_no = 10;
20
21 myAccount2.acct_type ='a';
22
23 myAccountArray[0].acct_no = 9;
24
25 struct account myAccount3 = {100,'R',"Hans Muster", 1023.9};
26
27 }