- #1
number0
- 104
- 0
Hello all,
I am trying to use a random function that my professor gave me:double rnd(int a){return (double)((a * random()) % 1000000000) / 1000000000; }Yes, I did include <stdlib.h>, <stdio.h>, and <math.h>. However, my compiler (Microsoft Visual Studio 2010 C++) does not recognize it as a function! By the way, I am programming the code in C, not C++.
Does anyone have any suggestion to my dilemma? Thank you for your time and response.
I am trying to use a random function that my professor gave me:double rnd(int a){return (double)((a * random()) % 1000000000) / 1000000000; }Yes, I did include <stdlib.h>, <stdio.h>, and <math.h>. However, my compiler (Microsoft Visual Studio 2010 C++) does not recognize it as a function! By the way, I am programming the code in C, not C++.
Does anyone have any suggestion to my dilemma? Thank you for your time and response.