#: 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
|