You’re passing a copy of the structure to the function. It returns a copy, but you’re not using the result.
You need to assign the result of the function to the variable.
z1 = spZ(z1);
More Related Contents:
- Is there a way to use a typedef struct variable in a function…? [closed]
- How can I correctly assign a new string value?
- self referential struct definition?
- How to define a typedef struct containing pointers to itself?
- “error: assignment to expression with array type error” when I assign a struct field (C)
- Opaque C structs: various ways to declare them
- Copying one structure to another
- struct serialization in C and transfer over MPI
- How do you make an array of structs in C?
- Passing struct to function
- Copy struct to struct in C
- Why can’t we initialize members inside a structure?
- Are C-structs with the same members types guaranteed to have the same layout in memory?
- Need help using qsort with an array of structs
- C : typedef struct name {…}; VS typedef struct{…} name;
- Why does “typdef struct { struct S *s; } S;” containing a pointer to same type compile?
- What does “request for member ‘*******’ in something not a structure or union” mean?
- How is the result struct of localtime allocated in C?
- How to initialize a structure with flexible array member
- memcpy vs assignment in C
- Why declare a struct that only contains an array in C?
- default value for struct member in C
- Anonymous union within struct not in c99?
- Array of size 0 at the end of struct [duplicate]
- C Typedef – Incomplete Type
- C initialize array within structure
- Is memset(&mystruct, 0, sizeof mystruct) same as mystruct = { 0 };?
- Can I ‘extend’ a struct in C?
- Iterating over same type struct members in C
- How can I malloc a struct array inside a function? Code works otherwise