On Wed, Jan 2, 2019 at 1:47 PM Richard Damon <rich...@damon-family.org>
wrote:

> On 12/30/18 6:10 PM, Richard Green wrote:
> const char *const zName; // Note extra space
>
> Then that is declaring that zName is an immutable pointer to a immutable
> string/character, which is actually likely true, as the code shouldn't
> be changing the names of pragmas.
>

Yeah, but a const T*const pointer must be initialized.
(unless it's a function argument, in which case it's the "caller" doing the
init, somehow).
Otherwise how else would you assign a value to that const pointer?

So as-is as a struct field, it wouldn't make sense.
C has no constructor like C++ has, to perform the assignment in the
"initializer list"
of the Ctor (i.e. between : and { ) (maybe aggregate initialization can,
that's as close
to a Ctor C has. May that would work...)

In Java you can, it's called a "blank final", i.e. compiler tracks at
compile-time when
the variable is first assigned, allowing that one, and errors out at all
other assignments (or if not initialized at all).

But in C/C++, I logically don't see how that makes sense. Haven't tried it
recently though :). --DD
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to