new to programming

Hello,
Thankyou for making me a part of you.
I am new to C++, recently i am working on C language. I need to know about random number generation, and the logic behind it.Randomly select coordinates (x,y) between 0 to 1 on both axis.i don't know from where to start.
thanks.
Hridaya.

Comments

  • www.msdn.com has pretty much all the documentation you need. The functions needed for random stuff is srand() and rand() located in stdlib.h. You need to know how functions work and how the modulo (%) operator works before you can do this project, so I suggest starting by learning those things unless you know them already.
  • : www.msdn.com has pretty much all the documentation you need. The
    : functions needed for random stuff is srand() and rand() located in
    : stdlib.h. You need to know how functions work and how the modulo (%)
    : operator works before you can do this project, so I suggest starting
    : by learning those things unless you know them already.

    [color=Blue]Values between 0 and 1 will not be produced using modulo operations. You need something like this:
    [code]
    double dblRandomValue = (double) rand () / (double) MAX_INT;
    [/code]
    [/color]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories