11.07.2015 Views

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

DescriptionPortabilitycalloc allocates space <strong>for</strong> an array of nmemb objects, each of whose size is size. Thespace is initialized to all zero bits.calloc returns a null pointer if the space <strong>for</strong> the array of object cannot be allocated fromfree memory; if space <strong>for</strong> the array can be allocated, calloc returns a pointer to the startof the allocated space.calloc con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).divSynopsisDescription#include div_t div(int numer, int denom);div computes numer / denom and numer % denom in a single operation.div returns a structure of type div_t (page 298) comprising both the quotient and theremainder. The structures contain the members quot (the quotient) and rem (theremainder), each of which has the same type as the arguments numer and denom. Ifeither part of the result cannot be represented, the behavior is undefined.Portabilitydiv con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).See also div_t (page 298)div_tSynopsis#include typedef struct {int quot;int rem;} div_t;Description div_t stores the quotient and remainder returned by div (page 298).Portabilitydiv_t con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).See also div (page 298)freeSynopsisDescription#include void free(void *ptr);free causes the space pointed to by ptr to be deallocated, that is, made available <strong>for</strong>further allocation. If ptr is a null pointer, no action occurs.298 Chapter 28 Standard C Library Reference

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

Saved successfully!

Ooh no, something went wrong!