Classes |
| struct | div_t |
| | Type that contains the quotient and reminder of a divison. More...
|
Defines |
| #define | RAND_MAX 0x7fffffff |
Typedefs |
| typedef struct div_t | div_t |
| | Type that contains the quotient and reminder of a divison.
|
Functions |
| int | atoi (const char *string) |
| | Converts ASCII number to integer.
|
| long | atol (const char *string) |
| div_t | div (int numer, int denom) |
| int | axtoi (const char *hexStg) |
| | Hexadecimal ASCII number to integer.
|
| long | strtol (const char *nptr, char **endptr, int base) |
| unsigned long | strtoul (const char *nptr, char **endptr, int base) |
| unsigned long long | strtoull (const char *nptr, char **endptr, int base) |
| char | ConvertUtf8ToLatin1 (const char *utf8, int *pnBytes) __attribute__((deprecated)) |
| int | StringEqual_utf8_latin1 (const char *utf8, const char *latin1) __attribute__((deprecated)) |
| int | find (const char *a, char b) |
| int | rand (void) |
| | Generate and return 31-bit random value.
|
| int | urand (void) |
| | Generate and return 32-bit random value.
|
| void | srand (unsigned int seed) |
| | Initialize random number generator.
|
| int | abs (int x) |
| void | bzero (void *s, size_t n) |
String conversion and pseudo-random number generation.
| void srand |
( |
unsigned int |
seed | ) |
|
Initialize random number generator.
The pseudo-random number generator is initialized using the argument passed as seed. For every different seed value used in a call to srand, the pseudo-random number generator can be expected to generate a different succession of results in the subsequent calls to rand. Two different initializations with the same seed, instructs the pseudo-random generator to generate the same succession of results for the subsequent calls to rand in both cases. If seed is set to 1, the generator is reinitialized to its initial value and produces the same values as before any call to rand or srand. In order to generate random-like numbers, srand is usually initialized to some distinctive value, like those related with the execution time.
- Parameters:
-
| seed | An integer value to be used as seed by the pseudo-random number generator algorithm. |