Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- typedef struct funcType {
- char name[31];
- int mat;
- float salary;
- }Func;
- void salAdjust(Func *worker, float adjust);
- int main(){
- Func *worker;
- worker = (Func *)malloc(sizeof(Func));
- strcpy(worker->name,"test");
- worker->mat = 2013000;
- worker->salary = 1000;
- salAdjust(worker, 310.25);
- printf("Salario ajustado : %f\n",worker->salary);
- return 0;
- }
- void salAdjust(Func *worker, float adjust){
- Func *p = worker;
- p->salary += adjust;
- }
Advertisement
Add Comment
Please, Sign In to add comment