13.07.2014 Views

Madagascar Programming Reference Manual

Madagascar Programming Reference Manual

Madagascar Programming Reference Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.1. CONVENIENCE ALLOCATION PROGRAMS (ALLOC.C) 37<br />

Input parameters<br />

n<br />

number of elements (size t).<br />

Output<br />

ptr<br />

a void pointer pointing to the allocated block of memory.<br />

4.1.9 sf complexalloc<br />

Allocates the memory for the sf complex type, that is, the size of the elements is, for<br />

example sizeof(sf complex).<br />

Call<br />

ptr = sf_complexalloc (n);<br />

Definition<br />

sf_complex *sf_complexalloc (size_t n /* number of elements */)<br />

/*< complex allocation >*/<br />

{<br />

...<br />

}<br />

Input parameters<br />

n<br />

number of elements (size t).<br />

Output<br />

ptr<br />

a void pointer pointing to the allocated block of memory.<br />

4.1.10 sf complexalloc2<br />

Allocates a 2D array in the memory for the sf complex type. It works just like sf complexalloc<br />

but does it for two dimensions. This is done by making a pointer point to another pointer,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!