Randoming and other basic info

Hey, I am a complete newbie to C++, and i was looking through your tutorial, and its amazing, but when i got to the arrays part it still left me wondering:
1. how to random a integer between two parametres
2. how to random a decimal between 0 and 1
3. how to completly clear my screen to get rid of old text
4. is there anyway I can easily draw a box or circle?
5. if possible, an easy way to import images, or do I have to use sprites?
thanks,
-Lucas
closed account (4Gb4jE8b)
1 & 2, see the documentation on rand()
http://www.cplusplus.com/reference/clibrary/cstdlib/rand/
don't forget to use srand when before the first use of rand(). There are more complex and more random ways of generating random numbers in the boost library. see
http://www.cplusplus.com/forum/beginner/34389/page3.html#msg186576

3, the easiest way is on windows is using system("cls"), though there are many downsides to using system calls

4 & 5 API or GUIs often make this pretty easy, but they are not included in the std library
wow that a fast reply!
and thanks alot for your help
closed account (4Gb4jE8b)
no problem
hey so i found that because when i base a random number on the time of day, that if i random a number more than once a second it gives me the same result. Can i random a number based on the previous result? or is there an easier way?
also, ive been looking at these forums and the general opinion is that anything system ("anything") is hated. why is it so bad?
one more thing, is there a way to delay the program? delay (1000)?
last thing, im used to turring where it was very simple just to draw a red box. GUIs are good for interface (from what i know), but i just want to draw a ball and get it to bounce around the screen. Is there anything like that in C++?
-thanks, Lucas
Topic archived. No new replies allowed.