Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://www.facebook.com/AminproPastebin
- #include <stdio.h>
- #include <string.h>
- struct staff{
- char name[10];
- int id;
- float allowance;
- };
- int main(void){
- struct staff oc1, *ocPtr;
- strcpy(oc1.name, "Ahmed");
- oc1.id = 1081112345;
- oc1.allowance = 135.8;
- struct staff oc2 = {"Patrick", 1071198763, 264.20};
- printf("Total = %.2f; Average = %.2f", oc1.allowance + oc2.allowance, ((oc1.allowance + oc2.allowance)/2));
- ocPtr = &oc1;
- ocPtr -> id = 1071112345; //or using (*ocPtr).id = 1071112345 //Page 209
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement