home *** CD-ROM | disk | FTP | other *** search
- // **************************************************************
- // halve1.cpp
- // Example program for Simple C++
- //
- // (c) 1999 Emmenjay Consulting Pty Ltd
- //
- // History
- // 05/05/99 MJS Initial Coding.
- //
- // **************************************************************
-
- #include <iostream>
-
- void halve( double *pval )
- {
- *pval = *pval / 2;
- }
-
- int main()
- {
- double d=10;
-
- // COMPUTE HALF
- std::cout << "Half of " << d << " equals ";
- halve( &d );
- std::cout << d << "\n";
-
- return 0;
- }
-
-