Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- typedef struct{
- float v1;
- float v2;
- }testas;
- testas tst;
- int testF(testas *stst)
- {
- stst->v1+=1.0f;
- stst->v2+=1.0f;
- return 0;
- }
- int main (int argc, char **argv)
- {
- tst.v1=0.1f;
- tst.v2=1.1f;
- printf("v1 before: %f\n",tst.v1);
- printf("v2 before: %f\n",tst.v2);
- testF(&tst);
- printf("v1 after: %f\n",tst.v1);
- printf("v2 after: %f\n",tst.v2);
- return 0;
- }
- /*
- output:
- v1 before: 0.100000
- v2 before: 1.100000
- v1 after: 1.100000
- v2 after: 2.100000
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement