> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Mansoor Nathani
> Sent: Wednesday, October 03, 2001 1:13 AM
> To: dev...@li...
> Subject: [Dev-C++] Help with functions
>
>
> Does any one know the functions for :
>
> Generating a random number (integer) between a given range.
#include <stdlib.h>
#include <time.h>
int x;
/* Use this one time anywhere in the program only */
srand(time(NULL));
x=rand(); /* One value between 0 and RAND_MAX, the most (and usually)
32767 */
x=rand();
...
>
> Extracting a character from a string: eg:
>
> ( "HELLO", 4 )
>
> that should output the fourth character : L
"Hello"[3];
After all literals are const arrays. :)
>
> Any help would be appreciated
>
> Mansoor
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
|