On Wed, 26 Apr 2017 09:30:50 -0700, Charles Mills ([email protected])
wrote about "Re: Can XLC printf() take "%D(*,*)"?" (in
<[email protected]>):

> Thanks. I will take your suggestions to heart and give them a try but the
> fact that the %D is printing as a D leads me to think that printf() is not
> recognizing the %D at all.

The usual action for a C run-time library is to print the format
literally if the passed parameters cannot be recognized as conformal to
the format. So a "D" can be expected.

>> You should not be passing a pointer (&x); everything is passed by value.
> 
> That may be a problem because I will then have to cast it as decimal and not
> sure I can do that in C++. I am wondering how I am going to cast it as I
> need to cast as D(s,p) and I don't know significance and precision at
> compile time, only at run time.
> 
> I wonder how C passes a potentially 16-byte string by value.

The usual hack is to wrap the char[] (array of bytes) in a struct and
pass the struct by value.

Alternatively, you could wimp out and code this run of code in plain C.
-- 
Regards,

Dave  [RLU #314465]
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
[email protected] (David W Noon)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to