#: 16297 S3/Languages
25-Aug-92 17:33:39
Sb: #16296-#Your July article
Fm: Mark Griffith 76070,41
To: Mike Haaland 72300,1433 (X)
Mike,
Well, if we were talking about System V here, then maybe I'd be less concerned.
However, were are talking about OSK I believe. I have looked at my headers
here are work (SunOS 4.1.2) and malloc and the rest are of type char *.
A type void pointer is a pointer that can later be declared to point to any
object. In the case of 'void *ptr', this would still be confusing to the new C
programmer, but legal in several compilers. That pointer can then be defined
as any type of pointer. Why one would want to do this instead of declaring it
to be what it will be used for is beyond me. I suppose someone might want to
do that to fool around with some byte size ordering or something of that
nature....surely something that is mnot easily portable or readable.
However, the malloc() and like functions do return a pointer of the character
type. Trying to declare that as something else later would to me make it
entirely too difficult. Even if OSK supported this, and that is the
questionable part, I would hesitate to use it in a 'teaching' environment. In
any case, explaining the use as 'so the compiler won't complain' is not what I
would call the best method.
If someone is going to take it upon themselves to act in a teaching role, then
they also take it upon themselves to have their 'product' as squeeky clean and
bug free as humanly possible. There is no excuse for anything less. Take it
from someone who has taught subjects such as this at the junior college
level....you have to pass the strictes scrutany (if course, I can spell the
words I want to use to make my point).
My point, in a nutshell, is Bob is working in areas outside the scope of the
OSK/OS-9 compilers, his explainations are lacking, and this can mislead those
people that are reading it and don't know any better. It should be in context
and clearer.
Mark
There are 3 Replies.
|