Example programs for blocks - GNU Scientific Library -- Reference Manual
Description: GNU Scientific Library -- Reference Manual

Previous: Reading and writing blocks, Up: Blocks

#### 8.2.3 Example programs for blocks

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 = %u\n", b->size);
           printf ("block data address = %#x\n", b->data);

           gsl_block_free (b);
           return 0;
         }

Here is the output from the program,

         length of block = 100
         block data address = 0x804b0d8

The GNU Scientific Library - a free numerical library licensed under the GNU GPL
Back to the GNU Scientific Library Homepage