× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I can write code in RPG to use pointers, once I understand what I am trying
to do, very quickly and accurately and test it fairly easy.

In C, however, I know what I want to do, I code it, then spend the next 10
minutes trying to convince the compiler I know what I'm doing.  I have to
convince the compiler that, yes, I know this is a character pointer, and
yes, I know I'm pointing it to a float value, just do I want I say,
compiler, quit trying to second guess me and compile already!

Most of the pointer bugs that crop in from my C++ code is from typed
pointers, not what I'm trying to do.

If RPG's pointers get typed, you're going to have to bring in type casting
with it's own brand of headaches and maintainance.  I say let well enough
alone and keep pointers are they are.  Type casting to me is a real needless
pain in the neck.

Regards,

Jim Langston

-----Original Message-----
From: boldt@ca.ibm.com [mailto:boldt@ca.ibm.com]

Jim wrote:

>Personally, I find RPG pointer use easier to use than C pointer use and
less
>prone to mysterious errors.  The Based mechanism makes sense once I
>understood it and helps reduce the number of times I'm pointing a pointer
to
>a pointer instead of the data or such.

Pointer support in C is light-years better than in RPG for the
simple reason that pointers in C are strongly typed.  If you use the
wrong basing pointer, the C compiler will tell you immediately, and
save you the trouble of tracking down potentially nasty run-time
problems.  I would estimate that your development time can double
when using untyped pointers.

Since structures in RPG are untyped (always considered character
type), there was really little choice in the design of pointers in
the RPG IV language.



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.