Had a nice discussion with Ilpo today.
Write down some experience.
actually allocate a continuous memory.
At first I thought it's like
so that I could manipulate on the pointer pt pt ...
and pass it to another function.
No, that doesn't work.
To solve my program, I did a small trick:
after that, I can use "pt" to do my tricks :)
Another note is that when use the
definition of struct
like: struct A example
we need to memset the 'example' before use it.
Because the stack in memory may leave some garbage information in the struct which can lead to unexpected failure. Like the one I encounter in the PSE project.
The msgsend struct always fail in sending msg because there is a garbage bit in the stack.
thank u Ilpo.