Re: [vox-tech] C - passing chars and pointer to chars
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vox-tech] C - passing chars and pointer to chars
On Sun 04 Jun 06, 9:57 AM, Ken Bloom <kbloom@gmail.com> said:
> On Sunday 04 June 2006 09:05, Peter Jay Salzman wrote:
> > On Sat 03 Jun 06, 10:27 PM, Ken Bloom <kbloom@gmail.com> said:
> > > Cue, the **Fundemental axiom of the C++ type system**, stated as
> > > follows:
> > > A* is automaitcally convertable to B* if and only if A is a B.
> > > (Likewise for pass by reference).
> > >
> > > (this is my own generalization though, and there may actually be
> > > exceptions)
>
> >
> > Although this was interesting to read, it doesn't say much other than
> > to restate my observation in a more sophisticated way.
>
> IMO, all that matters is that the axiom is the reason.
>
> --Ken
Herr Godel would say that this type of thinking is why it took humanity over
2000 years to discover non-Euclidean geometry. ;-)
BTW, "void *" seems to be an exception to the axiom:
p@satan$ cat bar.c
void f( void *b );
int main( void )
{
int a;
f( &a );
return 0;
}
p@satan$ gcc -W -Wall -c bar.c
p@satan$
A "int *" is convertable to "void *" even though an int isn't a void. There
is no data type of "void" (I think), but it's still a counter example.
BTW, you mentioned that it was a generalization of the fundamental axiom of
the C++ type system -- what is the fundamental axiom? That sounds like
something I should know, but I've never heard of it.
Pete
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech
|