Try using local variables, or allocate the struct using malloc() and settype() and a global pointer.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

What about the size of the malloc() for a struct containing variable size strings?
I guess the struct will contain just pointers to strings.
How big are pointers?
Will the garbage collection work well?

Or, if I will use char[] instead of string, is there any way to convert a char[] into a string?

PocketC variables all take up the same amount of "room", and are runtime typed.

malloc() on PocketC allocates <b><i>variables</i></b> not bytes of memory. So to allocate memory for a struct containing five fields of any type you use:

ptr = malloc(5) ;

You then use the settype() function to set the type of each field (to int, float, char or string; use int for pointers). You cannot declare a pointer to a struct in PocketC, but you can declare a reference to a struct. In order to use the malloced struct in an easily readable way, you need to allocate the memory in the main() function, then pass the pointer to the struct down to subsiduary functions which receive it as a reference to a struct. Alternatively you can access the fields in the struct using array indexing notation, it looks like an array where each element can be of a different type.

If you malloc() memory for a string, you still ask for 1 memory location. You can put a string of any length into it.

A PocketC variable is actually a C++ class object. It contains a union of the three numeric types and a reference to a string header. The string header points to the string which can be shared (if you copy a string to another string, all that happens is the headers are updated and the string reference count is incremented (and the reference to the previous value of the target string is updated).

Where is st2 being defined twice in the original post? Has it been updated?

Try using local variables, or allocate the struct using malloc() and settype() and a global pointer.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

Using global variables and a global pointer would be the easiest way.
Do I risk stack overflow using a big structure... or local variables are not on the stack (if sizeof() is not true memory size everything can happen)?

I don't think you'll have a stack problem unless you start using really big structs. I don't know how PocketC allocates local variables, it would have to fit in with its pointer handling.

sizeof() doesn't exist in PocketC.

If you run out of memory the PocketC runtime displays a message box and falls over.

Another alternative is to store your structs in "real" memory rather than PocketC memory. The CEAPI library lets you allocate chunks of real memory and transfer PocketC variables (including structs and arrays) between real memory/real variables and PocketC memory/PocketC variables.