Bubba <> writes:
> Keith Thompson's log on stardate 16 sij 2012
> I hoped for something like this in the first place, so thank you in
> advance!
>
>> Identifiers starting with underscores are reserved to the
>> implementation in most contexts. Identifiers starting with two
>> underscores are reserved in all contexts. You should never define
>> such identifiers yourself (unless you're writing code for a C
>> compiler or library implementation).
>
> What are the repercussions of choosing wrong number of underscores?
Undefined behavior.
If you're *lucky*, you'll happen to collide with an
implementation-defined identifier and your code will fail to compile.
If you're *unlucky*, your program works as you intended it to work, or
it will fail in subtle ways that are difficult to find.
The compiler and/or standard runtime library can do anything they like
with identifiers that start with "__", and nearly anything they like
with identifiers that start with a single underscore. If you define
such an identifier yourself, it may or may not conflict with a
system-defined identifier.
So don't do that.
[...]
>> And in fact I'd declare this as:
>> struct celltype *make_root(labeltype label, struct celltype **t);
>
> Could you please clarify the need for double pointer?
A "double pointer" could be either a pointer to a pointer, or a pointer
to type "double". It's better to refer to it as a pointer-to-pointer.
Why a pointer to a pointer? Don't ask me, it's your code; you declared
it with a pointer-to-pointer yourself. All I did was replace the
typedef (which hides the fact that the type is a pointer) with its full
definition.
But in general, if you want a function to modify something of type foo,
you need to pass it a foo*. In this case, "foo" happens to be a pointer
type itself.
[...]
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"