TIP: Click on subject to list as thread! ANSI
echo: cis.languages
to: Robert A. Hengstebeck 76417,2751 (X)
from: Pete Lyall 76703,4230
date: 1992-04-01 09:50:47
subject: #14747-getkey problem in C

#: 14748 S3/Languages
    01-Apr-92  09:50:47
Sb: #14747-getkey problem in C
Fm: Pete Lyall 76703,4230
To: Robert A. Hengstebeck 76417,2751 (X)

Actually, 'C' (or really C++) is bending in your direction...

In C++, you can pass variables by reference without using pointers:

   swap(a,b)

    .....

   swap( int& a, int& b)
        {
        int temp;

        temp = a;
        a = b;
        b = temp;
        }

There are a few nice things about this approach:

   1) You no longer have to dereference pointers
   2) It is more intuitive in the target function
   3) Because you're not using pointers, you have no
      opportunity to walk on something else.

I believe there's a GNU C++ for the OSK boxes...

Pete

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.