Sizeof Hooks

The Binding Generator C->Haskell : Implementation of Haskell Binding Modules : Sizeof Hooks
Previous: Type Hooks
Next: Enumeration Hooks

## 2.4. Sizeof Hooks

> `{#sizeof ident#}`

A sizeof hooks maps a C type to its size in bytes. As an example, consider

> `

>     gIntSize :: Int
>     gIntSize  = {#sizeof gint#}

> `

The type must be a defined type, primitive types, such as `int`, are not admissible. The size of primitive types can always be obtained using `Storable.sizeOf`.

The Binding Generator C->Haskell : Implementation of Haskell Binding Modules : Sizeof Hooks
Previous: Type Hooks
Next: Enumeration Hooks