You may download these copyrighted source code files for use in:
Object-Oriented Numeric Class Definitions -- C++ and Java
We're giving away Money!C++ or Java applications that handle amounts of money need a solid Money class that supports:
For background and details, see Conrad Weisert's paper: "Making C++ Practical for Business Applications", ACM SIGPLAN Notices, December, 1995.
Note that none of C's built-in or primitive data types is satisfactory. A series of articles in the C/C++ Users' Journal addressed conversion of money amounts to external representations, without proposing a practical Money class.
It's a DateIDI's component library contains a broad range of calendar manipulation and date conversion routines in PL/I, Basic, and Cobol, as well as complete class definitions in C++ and Java. The class definitions support the point-extent pattern for all meaningful operations on combinations of dates and durations. Naturally, all are Year-2000 compliant.
The Java version is available as freeware.
Warning: Never use Java's "standard"
New -- What's your
Integer Functions -- a pseudo class containing useful utility functions that perform operations on one or two integers:
NOTE: IDI's reusable component library also contains C++, Java, PL/I, and COBOL implementations of many of these routines. Call (773) 736-9661 for information.
A peculiarity in character-line representation raises an irritating problem. Each line of source code (ASCII text) is terminated by an end-of-line indicator (represented in C by '\n'). Unfortunately that code is rendered differently on different platforms, specifically:
Ordinarily this makes no difference to a compiler. Both codes are considered "white space" and are ignored, except in one situation. That situation arises when a line ends with the preprocessor continuation flag (\). Several C++ compilers get badly confused when they encounter the unexpected line termination characters following the backslash, and generate lots of irrelevant and misleading error diagnostics.
We consider that a compiler bug, but there's no point in arguing when you're in a hurry to get a clean compile.
The source code in these pages may contain the wrong kind of line-termination sequence for your platform. If so, you may have to edit the files, at least the lines that end in backslash. Using an editor under your platform, you can just remove the line breaks and then put them back in. That will correct the problem.
If you find this too irritating, let us know. IDI may in the future provide a software tool to scan a source-code file and make the necessary changes.
Return to top of freeware page.
Return to IDI home page.
Last modified August 1, 2005