Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

random value without creating object; int i = System::Random::Next(0,2) Why error?

$
0
0

error C2275: 'System::Random' : illegal use of this type as an expression
I
get this mistake if I try to build smt like this

int Number = System::Random::Next(0,4);

do I have to do it like this?

 Random^ rnd = (gcnew Random);
			 Number = rnd->Next(0,4);

thx


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>