Liste des Groupes | Revenir à cl c |
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:To write the declaration with names and the const access I want, so:
On 8/2/2024 3:29 PM, Ben Bacarisse wrote:No. If you intended a const pointer to const object why didn't you"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:>
>For some reason I had a sort of a habit wrt const pointers:Why? It seems like an arbitrary choice to const qualify some pointer
>
(experimental code, no ads, raw text...)
https://pastebin.com/raw/f52a443b1
>
________________________________
/* Interfaces
____________________________________________________________________*/
#include <stddef.h>
>
>
struct object_prv_vtable {
int (*fp_destroy) (void* const);
};
>
>
struct device_prv_vtable {
int (*fp_read) (void* const, void*, size_t);
int (*fp_write) (void* const, void const*, size_t);
};
types and some pointed-to types (but never both).
I just wanted to get the point across that the first parameter, aka, akin
to "this" in C++ is a const pointer. Shall not be modified in any way shape
or form. It is as it is, so to speak:
>
void foo(struct foobar const* const self);
>
constant pointer to a constant foobar, fair enough?
write that? My point was that the consts seems to be scattered about
without any apparent logic and you've not explained why.
Your habit of what?>;^)Does the wink mean I should not take what you write seriously? If so,
please ignore my question.
The wink was meant to show my habit in basically a jestful sort of
way.
Les messages affichés proviennent d'usenet.