검색결과 리스트
Technical Article/펌에 해당되는 글 242건
- 2006.11.06 Web Browser 컨트롤 FAQ
- 2006.11.06 GetLastError 값을 보고 싶을때
- 2006.11.06 C++에서 ADO를 이용한 Stored Procedure 사용법
- 2006.11.05 논문 쓰는 법 (이동만교수님曰)
- 2006.11.03 XML에 대한 심플한 정의~
- 2006.10.01 [팁] 32x32 아이콘을 16x16으로 변환
- 2006.08.10 2의 보수를 이용한 음수표현
- 2006.08.06 Win32 시리얼 통신 강좌
- 2006.05.26 %보다 aa-aa/10*10 가 빠르다!!!
- 2006.04.06 srand(time(null))
보호글
Technical Article/펌 2006. 11. 6. 02:06GetLastError 값을 보고 싶을때
보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력해주세요.
보호글
Technical Article/펌 2006. 11. 6. 02:04C++에서 ADO를 이용한 Stored Procedure 사용법
보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력해주세요.
보호글
Technical Article/펌 2006. 10. 1. 19:45[팁] 32x32 아이콘을 16x16으로 변환
보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력해주세요.
보호글
Technical Article/펌 2006. 5. 26. 03:10%보다 aa-aa/10*10 가 빠르다!!!
보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력해주세요.
글
Technical Article/펌 2006. 4. 6. 07:58srand(time(null))
cplusplus.com > reference > cstdlib > srand |
srand <stdlib.h> |
cplusplus.com |
Initialize random number generator.
Uses seed parameter to set a new starting point for generating random numbers with rand.
If seed is set to 1 the generator is reinitialized to its initial value as before any call to rand or srand.
In order to generate true random numbers it is suggested to use as seed a value that changes often, like the one returned by time function included in <time.h> (the number of seconds elapsed since newyear 1970).
Parameters.
- seed
- An integer value to be used as starting point with the pseudo-random number generator algorithm.
Return Value.
(none)
Portability.
Defined in ANSI-C.
Example.
/* rand/srand example */#include <stdio.h>#include <stdlib.h>#include <time.h>int main (){ /* initialize random generator */ srand ( time(NULL) ); /* generate some random numbers */ printf ("A number between 0 and 100: %d\n", rand()%100); printf ("A number between 20 and 30: %d\n", rand()%10+20); return 0;}
Output:
A number between 0 and 100: 93
A number between 20 and 30: 21
See also.
rand
RECENT COMMENT