COBOL Pointer variable

How to define a pointer variable


Define a pointer variable in Working-Storage Section


01  SILLY-POINTER                USAGE IS POINTER.


or


01  POINTERS-AND-OTHER-STUFF.
    05  SILLY-POINTER            USAGE IS POINTER.
    05  SILLY-VALUE              REDEFINES
        SILLY-POINTER            PIC S9(8) COMP.




Set pointer variable

Set from a regular variable
SET SILLY-POINTER TO ADDRESS OF RECORD-1.


RECORD-1 is a general variable in Working-Storage Section.


Set from another pointer
SET SILLY-POINTER TO SILLY-POINTER2.


SILLY-POINTER2 is another pointer type variable; so SILLY-POINTER and SILLY-POINTER2 point to same address.


Set to null
SET SILLY-POINTER TO NULL.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值