What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [split] C++ and VB debate

[split] C++ and VB debate
Author: Message:
TheAvenger
New Member
*


Posts: 9
Joined: Jun 2003
O.P. RE: RE: Random number generator?
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 :p


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?
09-06-2004 02:00 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On