loop lopy wrote:
I have changed from gpc into turbo pascal. The code that compiled for me in gpc doesnt compile now in turbo pascal. The code:
type NumNode = record Value: integer; pNext: ^ NumNode; end;
The compile error I get: Undefined type in pointer definition (NUMNODE)
Apart from the fact that TP can't compile Pascal, that shouldn't compile anywhere. You can't use NumNode until it is defined, and it isn't defined until the "end;" is encountered. Except to forward define a pointer type. Thus you need:
TYPE NumNodePtr = ^NumNode;
NumNode = RECORD Value : integer; pNext : NumNodePtr; END;
Get a Pascal book.