| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: c++ help |
From: "Geo."
"John Beckett" wrote in
message news:t2c7r0d4tmjul0a807paa26t2muv5bf6e3{at}4ax.com...
> In the above, "static" means that the variable fDoneInit retains its
> value between calls to the function. The result is that srand will
> only be called once, the first time OnPlay3 is entered.
>
> If more than one thread called OnPlay3, the above would not be
> adequate (each thread has to call srand).
As I understand it, in an MFC app when OnPlay3 is called it's created, when
it exits it's destroyed so wouldn't you need to initialize the random
generator each time it's created?
Geo.
--- BBBS/NT v4.01 Flag-5
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/45)SEEN-BY: 633/267 270 5030/786 @PATH: 379/45 1 396/45 106/2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.