I'm trying to port some code written in MS Visual C++ 8.0 (the version is copyright 1998, I know that for sure.) into MS Visual C++ 2005 Express. I've been having trouble trying to translate the code though.
I've been using #include<random> as a header to generate random numbers. After doing some reading, I've discovered that, these days, #include<cstdlib> is now used to produce random numbers.
I'm posting to require some help translating my randomized variables.
So;
generating random variables between 1 and 100 using #include<random>
randomize();
int num1, num2;
num1=1+random(100);
num2=1+random(100);
should become
int num1 = rand() % 100 + 1;
int num2 = rand() % 100 + 1;
Right? (I know there are probably some cleaner ways of declaring those variables :] )
Is there anything else I should know in order to avoid any complications while using #include<cstdlib>?
Any help or advice would be much appreciated! Thanks!