검색결과 리스트
Technical Article에 해당되는 글 282건
- 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))
- 2006.03.13 SQL Server 2000 Paging and Sorting
- 2006.03.10 MFC Assertions
보호글
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
트랙백
댓글
글
Technical Article/펌 2006. 3. 13. 16:54SQL Server 2000 Paging and Sorting
Using ROWCOUNT and SQL_VARIANT By DejaVudew
http://www.codeproject.com/useritems/SQLServer2KPagingSorting.asp
트랙백
댓글
글
Technical Article/펌 2006. 3. 10. 14:50MFC Assertions
MFC Assertions
MFC defines the ASSERT macro for assertion checking. It also defines the MFC ASSERT_VALID and CObject::AssertValid for checking the internal state of a CObject-derived object.
The MFC ASSERT macro halts program execution and alerts the user if the argument (an expression) evaluates to zero or false. If the expression evaluates to a nonzero, execution continues.
When an assertion fails, a message dialog box displays the name of the source file and the line number of the assertion. If you choose Retry in the dialog box, a call to AfxDebugBreak causes execution to break to the debugger. At that point, you can examine the call stack and other debugger facilities to determine the cause of the assertion failure. If you have enabled Just-in-time debugging, the dialog box can launch the debugger if it was not running when the assertion failure occurred.
The following example shows how to use ASSERT to check the return value of a function:
int x = SomeFunc(y);
ASSERT(x >= 0); // Assertion fails if x is negative
You can use ASSERT with the IsKindOf function to provide type checking of function arguments:
ASSERT( pObject1->IsKindOf( RUNTIME_CLASS( CPerson ) ) );
The ASSERT macro catches program errors only in the Debug version of your program. The macro produces no code in the Release version. If you need to evaluate the expression in the Release version, use the VERIFY macro instead of ASSERT.
See Also
Assertions
RECENT COMMENT