Next: CObject-testing, Previous: CObject-finalization, Up: CObject [Index]
Return another instance of the receiver’s class which points at &receiver[anInteger] (or, if you prefer, what ‘receiver + anInteger’ does in C).
If intOrPtr is an integer, return another instance of the receiver’s class pointing at &receiver[-anInteger] (or, if you prefer, what ‘receiver - anInteger’ does in C). If it is the same class as the receiver, return the difference in chars, i.e. in bytes, between the two pointed addresses (or, if you prefer, what ‘receiver - anotherCharPtr’ does in C)
Return a new CObject of the element type, corresponding to an object that is anIndex places past the receiver (remember that CObjects represent pointers and that C pointers behave like arrays). anIndex is zero-based, just like with all other C-style accessing.
Dereference a pointer that is anIndex places past the receiver (remember that CObjects represent pointers and that C pointers behave like arrays). anIndex is zero-based, just like with all other C-style accessing.
Store anIndex places past the receiver the passed Smalltalk object or CObject ‘aValue’; if it is a CObject is dereferenced: that is, this method is equivalent either to cobj[anIndex]=aValue or cobj[anIndex]=*aValue. anIndex is zero-based, just like with all other C-style accessing.
In both cases, aValue should be of the element type or of the corresponding Smalltalk type (that is, a String is ok for an array of CStrings) to avoid typing problems which however will not be signaled because C is untyped.
Adjust the pointer by sizeof(dereferencedType) bytes down (i.e. –receiver)
Adjust the pointer by anInteger elements down (i.e. receiver -= anInteger)
Adjust the pointer by sizeof(dereferencedType) bytes up (i.e. ++receiver)
Adjust the pointer by anInteger elements up (i.e. receiver += anInteger)
Next: CObject-testing, Previous: CObject-finalization, Up: CObject [Index]