output should be;
0
00
99.9
I get
9
9
9
9
I have to say I’m not clear on where to use the variable and where to use a pointer in these functions
Help Please
Note that a pointer is a variable - the value of a pointer variable is the address of something and, because it’s a variable, you can change that value at run time; ie, you can assign a new value to it.
The name of an array acts, in many ways, like a pointer - because it gives the address of the 1st element of the array - but the key difference is that you cannot assign a value to it. Its value is fixed at build time.
Also note that “==” is not the assignment operator in ‘C’ !
The “==” double-equals is a comparison operator that checks if its two operands are equal!
Thus this code contains two mistakes:
temp15==strncpy(&gpsbuff[startp],temp15,len); // This is not an assignment, and would be illegal as an assignment!
You are trying to assign to an array name - which is not allowed;
You are using the equality comparison operator (==) instead of the assignment operator (=)
temp15 == strncpy( &gpsbuff[startp], temp15, len );
Once you’ve corrected the errors noted above, I think you also need to check carefully that you have the parameters to strncpy in the correct order for your required result…
BTW: a little whitespace goes a long way in making code more readable…
It isn’t the place of the Wavecom documentation to teach you the ‘C’ language - it is assumed that you are already a competent ‘C’ programmer.
Yes, it is a signed 32-bit integer
And u32 is an unsigned 32-bit integer.
Similarly for u16/s16 and u8/s8
But you’re right - they are not documented
I guess they used to be documented in the so-called “Basic (sic) Development Guide” - now discontinued - and Wavecom forgot to put them into the ADL User Guide when the Basic guide was discontinued…
See: viewtopic.php?f=3&t=3692&p=14287#p14284
But you can see the definitions in wm_types.h
The problem with %f is documented - and a workaround is given.