Hello,
I have some problems to understand the syntax and the meaning of some pointers used in a C sfunction For example taken the output method of the TimesTwo sfunction
From which I reported an extract hereafter
Int_T i; InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs(S,0); real_T *y = ssGetOutputPortRealSignal(S,0); int_T width = ssGetOutputPortWidth(S,0); for (i=0; i<width; i++) { /* * This example does not implement complex signal handling. * To find out see an example about how to handle complex signal in * S-function, see sdotproduct.c for details. */ *y++ = 2.0 *(*uPtrs[i]); } }
what is it supposed to mean *y++ (is the value to which the y pointer refers, isn't? but I'm wondering why there is the ++ notation following *y, I thought it's to point to the next memory area because we deal with a static vector). Am I right?
And what does it means (*uPtrs[i])? I thought it was the value of the variable to which the pointer points to.
is there anyone, who can help me to figure it out? can you suggest me some good references to understand how this stuff works?
thanks for reading
Best Answer