Previous: Reading and writing blocks, Up: Blocks [Index]
The following program shows how to allocate a block,
#include <stdio.h> #include <gsl/gsl_block.h> int main (void) { gsl_block * b = gsl_block_alloc (100); printf ("length of block = %zu\n", b->size); printf ("block data address = %p\n", b->data); gsl_block_free (b); return 0; }
Here is the output from the program,
length of block = 100 block data address = 0x804b0d8