++
binds tighter than *
.
So
*analyzers->analyzer2.log++;
- Increments
...log
(a pointer!) - Dereferences the result of 1 (which most probably points to invalid memory and with dereferencing it therefore invokes undefined behaviour and with this the observed crash)
To increment where ...log
points to, do:
(*analyzers->analyzer2.log)++;
That is:
- Dereference
analyzers->analyzer2.log
- Increment to what step 1 points to