× 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 added             #include <decimal.h>

And it compiled just fine.

The output looks like

 a = -1 ; b = -1
 Press ENTER to end terminal session.
-------------------------
 Bryan Dietz
3X Corporation
614-410-9205






"Jevgeni Astanovski" <J.Astanovski@sampopank.ee>
Sent by: c400-l-admin@midrange.com
12/16/2002 11:34 AM
Please respond to
c400-l@midrange.com


To
<c400-l@midrange.com>
cc

Subject
RE: [C400-L] Decimal Problem






OK, try this one:
With 4.5 it works.
If it does not work with 5.1, then I have a feeling, that the guys have
forgotten about decimal.....

int main(int argc, char *argv[])
{
  int a ;
  char szTemp[16] ;
  decimal (5,0) b ;

  a = -1 ;
  sprintf(szTemp, "%5d", a) ;
  sscanf(szTemp, "%D(5,0)", &b) ;
  printf ("a = %d ; b = %D(5,0)\n", a, b) ;
  return(1) ;
}

> -----Original Message-----
> From: Peter.Daransky@ambos.at [mailto:Peter.Daransky@ambos.at]
> Sent: 16. detsember 2002. A. 12:02
> To: c400-l@midrange.com
> Subject: RE: [C400-L] Decimal Problem
>
>
> This is a multipart message in MIME format.
> --
> [ Picked text/plain from multipart/alternative ]
> hi,
> yes that is the Problem ... on V4R5 have i no problems too ...
> but trying compile & rund the same progam for V5R1 is problem ...
>
> Regards
>
> Peter Daransky
> AMBOS EDV-Beratungs GesmbH
> Dauphinestr. 44
> A-4020 LINZ               Austria
> Tel:         +43-732-312919-0
> Fax:        +43-732-312919-20
> e-mail:  Peter.Daransky@ambos.at
> Homepage: http://www.ambos.at
> _______________________________________________
> This is the C programming iSeries / AS400 (C400-L) mailing list
> To post a message email: C400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/c400-l
> or email: C400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/c400-l.
>
>

_______________________________________________
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/c400-l
or email: C400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.