Re: [Dev-C++] alternative functions have delay, random and randomize
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <ri...@te...> - 2003-08-10 20:24:38
|
Ricardo Amores Hernández escribió:
I´ve have such a terrible english :( :(
Use this header and you should be able to use random() and randomize().
But I encourage you
to get used to rand() and srand() C standard functions
> #ifndef __MY_RANDOM__
> #define __MY_RANDOM__
>
> #ifndef _TIME_H_
> #include <time.h>
> #endif
>
> #ifndef _STDLIB_H_
> #include <stdlib.h>
> #endif
>
> #define randomize() srand(time(NULL))
Sorry, there was mistake in this line
#define random(x) (rand() % (x))
//was #define random(x) (rand() % (x)) +1 )
> #endif /* __MY_RANDOM__ */
>
>
> I don´t know a delay(), but you could use a conio library for Dev-C++.
> Here you have one (Spanish link)
By the way, when I said "I don´t know", I mean: "There is no delay() or
similar function in C nor C++ standard library" ;)
--
---------------------------------------------------
Ricardo Amores Hernández
ICQ: 19463735
MSN: zheo_ (at) hotmail (dot) es
---------------------------------------------------
|