Standard C++ Library Reference ISO/IEC (VERSION3)
whose size is not greater than size.
If ptr is not a null pointer, it must be the address of an existing object that you first allocate by
calling calloc, malloc, or realloc. If the existing object is not larger than the newly
allocated object, realloc copies the entire existing object to the initial part of the allocated
object. (The values stored in the remainder of the object are indeterminate.) Otherwise, the
function copies only the initial part of the existing object that fits in the allocated object. If
realloc succeeds in allocating a new object, it deallocates the existing object. Otherwise, the
existing object is left unchanged.
If ptr is a null pointer, the function does not store initial values in the newly created object.
size_t
typedef ui-type size_t;
The type is the unsigned integer type ui-type of an object that you declare to store the result
of the sizeof operator.
srand
void srand(unsigned int seed);
The function stores the seed value seed in a static-duration object that rand uses to compute a
pseudo-random number. From a given seed value, that function always generates the same
sequence of return values. The program behaves as if the target environment calls srand(1)
at program startup.
strtod
double strtod(const char *s, char **endptr);
The function converts the initial characters of the string s to an equivalent value x of type
double. If endptr is not a null pointer, the function stores a pointer to the unconverted
remainder of the string in *endptr. The function then returns x.
The initial characters of the string s must consist of zero or more characters for which
isspace returns nonzero, followed by an optional plus or minus sign, followed by the longest
sequence of one or more characters that match the pattern for strtod shown in the diagram.