游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2746|回复: 4

请教srand(GetTickCount())的作用

[复制链接]

3

主题

8

帖子

8

积分

新手上路

Rank: 1

积分
8
发表于 2011-7-9 16:57:00 | 显示全部楼层 |阅读模式
我想不懂,感觉删了也没不一样,请教大大解释 [em7]

0

主题

54

帖子

139

积分

注册会员

Rank: 2

积分
139
发表于 2011-7-9 18:03:00 | 显示全部楼层

Re:请教srand(GetTickCount())的作用

GetTickCount
The GetTickCount function retrieves the number of milliseconds that have elapsed since the system was started. It is limited to the resolution of the system timer. If you need a higher resolution timer, use amultimedia timer or a high-resolution timer.

srand
Sets a random starting point.

看到不懂的函数都不会查MSDN么?
以当前时间(微秒级)作为随机函数的起点(种子)。用来实现像随机的伪随机的。如果不知道什么叫伪随机,请度娘。

3

主题

8

帖子

8

积分

新手上路

Rank: 1

积分
8
 楼主| 发表于 2011-7-9 20:06:00 | 显示全部楼层

Re:请教srand(GetTickCount())的作用

受教了~~感激不尽

0

主题

398

帖子

577

积分

高级会员

Rank: 4

积分
577
发表于 2011-7-11 13:38:00 | 显示全部楼层

Re:请教srand(GetTickCount())的作用

是毫秒级.

0

主题

54

帖子

139

积分

注册会员

Rank: 2

积分
139
发表于 2011-7-11 21:14:00 | 显示全部楼层

Re:请教srand(GetTickCount())的作用

哦,抱歉,写错了。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-6-8 10:24

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表