[swift-users] C Pointers and Memory

Dmitri Gribenko gribozavr at gmail.com
Thu Jul 28 15:32:48 CDT 2016


On Thu, Jul 28, 2016 at 1:27 PM, James Campbell via swift-users
<swift-users at swift.org> wrote:
> How are arrays passed to C in Linux ? I tried unwrapping an optional array
> in an if statment and passing it to c. it seemed like the array was
> deallocated however if I stored it in a local var in the function before the
> if statment it worked perfectly fine, sureley this shouldn't work either ?

Would you mind pasting the code example?

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/


More information about the swift-users mailing list