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 19:42:45
|
Rhuan Barros escribió:
> -------english------tranlated with google
>
> somebody knows some function alternative delay,
> random, randomize of the turbo c++, for dev c++, is
> thankful since already!
Use this header and you could use random() and randomize(). But you
should get used to the 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))
#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)
http://c.conclase.net/conio/index.php
Regards
--
---------------------------------------------------
Ricardo Amores Hernández
ICQ: 19463735
MSN: zheo_ (at) hotmail (dot) es
---------------------------------------------------
|