|
From: Ioannis V. <no...@ya...> - 2001-10-03 09:54:25
|
> -----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 |