A
          / \      _             Play Now                         Nemesis on fb
          | |     | |  _______   _        _   _______    _______   _    _______
          | |\    | | |   ____| |  \    /  | |   ____|  /   ____| | |  /   ____|
 /-------/-------------------------------------------------------------------,
O= Home <=XX|  About  News  Pics  Adventurers  Wizards  Download  Connect     >
 \-------\-------------------------------------------------------------------'
          | |   \   | |  |____  | |      | | |  |____   ___ \  \  | |  ___ \  \
          | |     \_| |_______| |_|      |_| |_______| |_______/  |_| |_______/
          \ /
           V  

Documentation Area

Document Path: /doc/efun/allocate


Name: allocate - allocate an array

Synopsis:
	int *allocate(int size)

Description:
	Allocates an array of 'size' elements. This means that it returns an
	array of which all elements are 0. The number of elements must be
	greater than zero and not bigger than the system maximum (usually
	1000).

	You can access members of the array with the []-operator. Note,
	that initialized arrays, using ({ }), don't have to be allocated.

Return value: the allocated array

Examples:
	Creating a numbers array, covering numbers from 0-9:

		string *numbers=allocate(10);
		numbers[0]="zero";
		numbers[1]="one";
		...
		numbers[9]="nine";

	does actually the same as:

		string *numbers=({ "zero", "one", ... "nine" });

See also:


This page was generated in LPC

Imprint / Impressum