6.8 Pointers

-------------

In C-- pointers are not fully supported, and thus many things which are

possible in ordinary C are not possible here.

Example of use of pointers in C--:

char *string[4]={"string1", "string2", "string3", 0}; //array of pointers

char *str="string4";

main()

int i;

char *tstr;

{

FOR(i=0; string[i]!=0; i++){

WRITESTR(string[i]);

WRITELN();

}

FOR(tstr=str;byte *tstr!=0; tstr++){

WRITE(byte *tstr);

}

}

Pointers can be used when passing options to functions and in the

functions themselves as local or parametric variables. Pointers can also be

used in structures. There can be pointers to pointers. There is now

support of pointers to functions:

void (*proc)(); //declaration of pointer to function

By default pointers to a function are in PASCAL style, independent of

the register in which the function name was written or the compilation

mode. If another type of call must be used, a pointer to a function must be

indicated at declaration.

During initialization of pointers the compiler has no control over how

the pointer is initialized, i. e., a pointer to 'int' may be assigned to a

pointer to 'char', or a variable address may be assigned to a function.

This may result in an error when the program is run.