Re: C-like Structures

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu