I’ve asked this on email support but I’m hoping to get a quicker answer here.
I read in the docs that structures are passed by VALUE in DC 9.62 and not by reference as in all other Cs I’ve used.
I have a function that “reads” a command string that is in the structure and sets various other elements of the structure based on the string. For example:
mbp.cmdID = (int)mbp.cmdstring ; (The first two bytes are an ID word)
This works great IN the function (according to the watch window) but it’s only working with a COPY of the structure since it was passed in by value on the stack and the changes are not made in the original structure.
If I try to pass &cmd_packet, I get an invalid structure reference error when I compile. Is there anyway to pass a pointer to a structure so I can modify it’s elements in a function?
Any examples of doing this, how to define the functions parameters, etc. would be greatly appreciated.
len morgan