Click here to Skip to main content
15,908,274 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: To refresh Data in my DataGridView Pin
Paul Conrad14-Jul-07 13:39
professionalPaul Conrad14-Jul-07 13:39 
Questiondynamic cast question Pin
Programm3r3-Jul-07 4:27
Programm3r3-Jul-07 4:27 
AnswerRe: dynamic cast question Pin
George L. Jackson3-Jul-07 10:53
George L. Jackson3-Jul-07 10:53 
GeneralRe: dynamic cast question Pin
Programm3r3-Jul-07 19:54
Programm3r3-Jul-07 19:54 
QuestionWinPcap C++ CLI Pin
abbd3-Jul-07 4:01
abbd3-Jul-07 4:01 
QuestionHelp Needed Fast Pin
A. K. S3-Jul-07 1:43
A. K. S3-Jul-07 1:43 
AnswerRe: Help Needed Fast Pin
Pete O'Hanlon3-Jul-07 1:53
mvePete O'Hanlon3-Jul-07 1:53 
Questionsrand in c or c++ doesn't really Generate Random Numbers ? Pin
snailflying2-Jul-07 21:45
snailflying2-Jul-07 21:45 
Hi All
I am using the srand function generate random numbers.Here is the problem.

for example:
#include<iostream>
#include <time.h>

int main()
{
int i = 0,j = 0;

srand((int)time(0));

for(i=0; i<10; i++)
{
j=1+(int)(10.0*rand()/(RAND_MAX+1.0));
std::cout << j << '\t';
}
std::cout << std::endl;
return 0;
}
result&#65306;
5 8 8 8 10 2 10 8 9 9
2 9 7 4 10 3 2 10 8 7

The problem is that the two lines of the results are the same when the compiler run over in one second.
How the function works?
how the computer make the rand numbers?
Does the function can generate really Random Numbers ?

Please help me out if you find some solution for the above problem.
Thanks in advancs !



Where did the good times go?
Don't try it, just do it!

*Archibald*rever dragon!
AnswerRe: srand in c or c++ doesn't really Generate Random Numbers ? Pin
Pete O'Hanlon3-Jul-07 1:57
mvePete O'Hanlon3-Jul-07 1:57 
GeneralRe: srand in c or c++ doesn't really Generate Random Numbers ? Pin
snailflying3-Jul-07 15:53
snailflying3-Jul-07 15:53 
QuestionInterior Pointer vs Handle Pin
iddqd5152-Jul-07 4:37
iddqd5152-Jul-07 4:37 
AnswerRe: Interior Pointer vs Handle Pin
led mike2-Jul-07 5:07
led mike2-Jul-07 5:07 
GeneralRe: Interior Pointer vs Handle Pin
iddqd5152-Jul-07 5:25
iddqd5152-Jul-07 5:25 
GeneralRe: Interior Pointer vs Handle Pin
George L. Jackson2-Jul-07 14:23
George L. Jackson2-Jul-07 14:23 
GeneralRe: Interior Pointer vs Handle Pin
iddqd5153-Jul-07 3:30
iddqd5153-Jul-07 3:30 
GeneralRe: Interior Pointer vs Handle Pin
Geo Pa3-Jul-07 8:02
Geo Pa3-Jul-07 8:02 
GeneralRe: Interior Pointer vs Handle Pin
iddqd5153-Jul-07 8:35
iddqd5153-Jul-07 8:35 
QuestionDataSet Array Pin
MAW301-Jul-07 22:36
MAW301-Jul-07 22:36 
AnswerRe: DataSet Array Pin
George L. Jackson2-Jul-07 14:32
George L. Jackson2-Jul-07 14:32 
GeneralRe: DataSet Array Pin
MAW302-Jul-07 17:23
MAW302-Jul-07 17:23 
GeneralRe: DataSet Array Pin
George L. Jackson2-Jul-07 23:57
George L. Jackson2-Jul-07 23:57 
GeneralRe: DataSet Array Pin
MAW303-Jul-07 11:46
MAW303-Jul-07 11:46 
GeneralRe: DataSet Array Pin
George L. Jackson5-Jul-07 8:18
George L. Jackson5-Jul-07 8:18 
GeneralRe: DataSet Array Pin
MAW305-Jul-07 11:44
MAW305-Jul-07 11:44 
QuestionHow to get the seconds/milliseconds in DateTime? Pin
C#Coudou1-Jul-07 16:26
C#Coudou1-Jul-07 16:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.