Re: C-like Structures
- Posted by raseu Jul 09, 2011
- 2993 views
nice!
couple of questions
1) is the memstruct implementation dot preprocessor based or part of the
euphoria language. ie : is memstruct a new data type (along with sequence, atom etc ...)
2) i have taken a look at the memstruct test case
http://scm.openeuphoria.org/hg/euphoria/file/78edc3d4f6d8/tests/t_memstruct.e
given the allocation
63 atom symtab = allocate( 5 * sizeof( symtab_entry ) )
64 poke( symtab, repeat( 0, 5 * sizeof( symtab_entry ) ) )
what do the following lines assign to (first item in array ?)
65 symtab.symtab_entry.obj = 9
66 symtab.symtab_entry.obj += 5
67 symtab.symtab_entry.obj -= 2
68 symtab.symtab_entry.obj *= 6
69 symtab.symtab_entry.obj /= 3
i ask because further down you have the following
73 symtab.symtab_entry[1].obj = 1
tia