Re: Passing pointer to c array
- Posted by JJProg at CYBERBURY.NET Jul 21, 1999
- 463 views
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})