11.07.2015 Views

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

See Also srand (page 302) RAND_MAX (page 302)RAND_MAXSynopsisDescriptionPortability#include #define RAND_MAX 32767RAND_MAX expands to an integer constant expression that is the maximum valuereturned by rand.RAND_MAX con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).See Also rand (page 301) srand (page 302)reallocSynopsisDescriptionNotesPortability#include void *realloc(void *ptr, size_t size);realloc deallocates the old object pointed to by ptr and returns a pointer to a new objectthat has the size specified by size. The contents of the newobject is identical to that of the old object prior to deallocation, up to the lesser of thenew and old sizes. Any bytes in the new object beyond the size of the old object haveindeterminate values.If ptr is a null pointer, realloc behaves like malloc <strong>for</strong> the specified size. If memory <strong>for</strong>the new object cannot be allocated, the old object is not deallocated and its value isunchanged.realloc function returns a pointer to the new object (which may have the same value asa pointer to the old object), or a null pointer if the new object could not be allocated.If ptr does not match a pointer earlier returned by calloc, malloc, or realloc, or if thespace has been deallocated by a call to free or realloc, the behaviour is undefined.realloc con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).srandSynopsisDescription#include void srand(unsigned int seed);srand uses the argument seed as a seed <strong>for</strong> a new sequence of pseudo-randomnumbers to be returned by subsequent calls to rand. If srand is called with the sameseed value, the same sequence of pseudo-random numbers is generated.If rand is called be<strong>for</strong>e any calls to srand have been made, a sequence is generated asif srand is first called with a seed value of 1.302 Chapter 28 Standard C Library Reference

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

Saved successfully!

Ooh no, something went wrong!