I never noticed thatI would have done;
int numbers[] = { 6,10,14,18,22 };
cout << numbers[ int(rand() % 5) ];
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
|
Results 1 to 15 of 18
Thread: Print a random number from setThreaded View
|
Click Here to Expand Forum to Full Width |