|
C is a pass-by-value language. However, those parameters can be pointers. The pointer can point to a value, however.
On i, the argument vector (argv) is an array of pointers to the argument values which are the parameters passed on the call.
Returning a value through the arguments is simply replacing the value at the memory location dereferenced from the pointer. One must be aware of the size of the memory space referenced and the type of value that is to be there.
Jt400 class AS400Text.toBytes() is convenient for converting java string to byte array. If your c program is expecting an 80 character array, new AS400Text(80,system).toBytes("StringToPass",sytemvalue) will put the contents of "StringToPass" into systemvalue (an 80 character byte array). Pass systemvalue to the c program. Define systemvalue as byte[]systemvalue = new byte[80].
I don't use PCML to do this. PCML-related objects may do a lot of this work for you.
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.