Re: Passing pointer to c array

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

EU>I need to create a null-terminated array of strings in Euphoria, and obtain
EU>pointer to the array.
EU>In C it is:

EU>char *words[] = {
EU>        "Apples", "Oranges", "Lemons", "Pineapple", NULL
EU>                      };

EU>then the pointer words is passed to the listbox function.:
EU>newlistbox(words, coords, click-function)

EU>How do I do this in Euphoria?
EU>Thanks,

EU>Irv

Try:

include machine.e
atom apples, oranges, lemons, pineapple, array
apples = allocate_string("Apples")
oranges = allocate_string("Oranges")
lemons = allocate_string("Lemons")
pineapple = allocate_string("Pineapple")
array = allocate(20)
poke4(array,{apples,oranges,lemons,pineapple,0})

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

Search



Quick Links

User menu

Not signed in.

Misc Menu