|
You're right about the strong vs weak typing. That's what gives the string data type its ambiguity. You can assign a string literal to a string variable even though it's really defined as a pointer to character, for example. I assume that's what makes the argument list in printf() so "flexible." The interesting (?) thing is that C data types are associated with data types while RPG pointers are what they call "void" in C. C++ is strongly typed only if you agree to abide by the rules. There's nothing to prevent you to write code that violates every rule of OOP using C++ syntax. I have a book at home that I bought about 8 years ago that purports to be about C++ that provides a fine example of this. One of the abominations in this book was the use of the printf() family in place of the iostream stuff. I wonder, and I haven't written anything in C or C++ since I took up RPG a while back, if you couldn't write something that would work for RPG that used C++ I/O. That would be almost as much work as the workaround of an infinite number of prototypes for printf(). (Poetic license, OK?) BTW, the MOVE opcode lets you get around a lot of the strong typing. I've never moved a character into a numeric or vice versa myself, but...<g> > -----Original Message----- > From: Richard Jackson [mailto:richardjackson@richardjackson.net] > Sent: Monday, September 25, 2000 12:32 PM > To: RPG400-L@midrange.com > Subject: RE: Prototyping printf() > > > Joel: > > The issue is more like "strong vs weak typing". RPG is > strongly typed. C > is weakly typed. C++ is strongly typed ... is there a way to > perform printf > in C++ that is analogous to what Simon wants to do in RPG? > +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.