Admin Production ni-theme
Current Publication

rand

LabWindows/CVI

rand

int rand (void);

Purpose

Computes a pseudorandom integer in the range 0 to RAND_MAX.

Note Note  If this function is called before any call to srand, the seed value will default to 1.

Parameters

None.

Return Value

Name Type Description
randomNumber int Contains the pseudorandom number generated by the function.

Additional Information

Library: ANSI C Library

Include file: ansi_c.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

Examples

Refer to the following examples that use the rand function:

  • analysis\interp.cws

    Open example
  • userint\callback.cws

    Open example
  • userint\graphlegend.cws

    Open example
  • userint\graphs.cws

    Open example
  • utility\threading\ThreadedGuessers\ThreadedGuessers.cws

    Open example