P
Peter Nilsson
A good question, but one you probably should have asked in
isolation first. Find out what you're trying to solve before
proposing a solution.
It would mean more typing. That would be enough for me!
No, he's talking about a C without void *. void was obviously
brought in to allow functions that do not return values (what
other languages call procedures.) The decision to allow void *
was quite deliberate, but not such an obvious one!
Aesthetically the concept of a generic pointer sits better with
void * than unsigned char *, but I can't think of an obvious
practical reason why the latter wasn't adopted. It already was
the pseudo generic pointer type pre ANSI C, so it wouldn't have
harmed existing code too much, or presented a much different
(let alone difficult) paradigm.
I'd rather see a discussion on how generic programming in C
can be improved, than quibling over the base type for generic
pointers. But I think we already know the answer to that: if
you want C++ you know where to find it.
isolation first. Find out what you're trying to solve before
proposing a solution.
It would mean more typing. That would be enough for me!
No, he's talking about a C without void *. void was obviously
brought in to allow functions that do not return values (what
other languages call procedures.) The decision to allow void *
was quite deliberate, but not such an obvious one!
Aesthetically the concept of a generic pointer sits better with
void * than unsigned char *, but I can't think of an obvious
practical reason why the latter wasn't adopted. It already was
the pseudo generic pointer type pre ANSI C, so it wouldn't have
harmed existing code too much, or presented a much different
(let alone difficult) paradigm.
I'd rather see a discussion on how generic programming in C
can be improved, than quibling over the base type for generic
pointers. But I think we already know the answer to that: if
you want C++ you know where to find it.