quote:
Originally posted by NoName
Its all over google in any language
code:
In Form_Load()
Randomize
End Sub
Public Function Rand(ByVal Low As Long, _
ByVal High As Long) As Long
Rand = Int((High - Low + 1) * Rnd) + Low
End Function
(Visual Basics)
code:
include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
int random_integer = rand();
cout << random_integer << endl;
}
random_integer = (rand()%10);
(C++)
Notice the VB one makes sense while the C++ one just seems like a bunch of random jabber
as a c++ programmer. I'll have to disagree with you here. The c++ seems perfectly logical and straight forward. How come you need to have some weird form_load function just to say randomize? And what is ByVal supposed to represent? int? string?... maybe bool? And where does it print the result? Does it print the result? And you actually have to DECLARE the end of the function? What a } isn't easy enough?