|
C uses what are called "typed pointers". In C when you declare a pointer you have to declare what it is pointing to. int *MyInt; // A pointer to an integer or array of integer char *MyChar; // A pointer to a character or array of characters float *MyFloat; // A pointer to a float or array of floats In RPG we use what are called "untyped pointers". We just declare a pointer, it can point to anything. D MyPointer * We generally BASE it on something to use it as a type. In C the syntax: char *MyChar; Would be in RPG: D MyChar 1A D @MyChar * BASED(MyChar) HTH, Regards, Jim Langston -----Original Message----- From: Sunil [mailto:sunil_ramakumar@USSWI.com] Hai, I am a bit new to pointers and the related stuff in RPG. I am confused when some authors say *char, string* etc. As far as my understanding goes you cant define a datatype for a pointer ( infact pointer itself is a datatype, right!!). Am I right? If I am what does *char mean? Does it simply refer to the data that we know must is stored in the memory space pointed by the pointer? Regards Sunil
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.