nietod
asked on
Syntax of const pointer reference.
Ignoring the issue that is surely a bad program design. I need to return a reference to a constant pointer. The syntax
const Obj * &
is wrong, it means that the thing pointed to is constant. I believe that what I want is
Obj * const &
Is that correct? Also can I do this with a non-pointer. Like does
int const &
mean the same as
const int &
const Obj * &
is wrong, it means that the thing pointed to is constant. I believe that what I want is
Obj * const &
Is that correct? Also can I do this with a non-pointer. Like does
int const &
mean the same as
const int &
const binds to the left except when it's the first token.
Are you trying to do a reference return? Or is this a parameter being passed?
That is, the thing to the left of the const is constant (unless the const is the first token of the declaration, then the thing to the right of the const is constant).
Beware geeks bearing GIFs!
Beware geeks bearing GIFs!
ASKER
>> the thing to the left of the const is constant (unless the const is the first
>> token of the declaration, then the thing to the right of the const is constant)
This language is a mess! The only thing worse than writting in it would be writting a compiler for it!
Why don't you answer, Alex?
>> token of the declaration, then the thing to the right of the const is constant)
This language is a mess! The only thing worse than writting in it would be writting a compiler for it!
Why don't you answer, Alex?
char *y="testing";
ASKER
Was that meant for a different question? It seems to have nothing to do with my question. Besides my question was answered and I invited Alexo to submit an answer.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Now do I let this sit around and be Autograded????? I guess not.
>> Now do I let this sit around and be Autograded?????
Hell, why not? I already got Roger "subtly suggesting" all over the place that customers reject my answers and Andrewyu shouting "thank you!" and gracing my answer with a D...
Hell, why not? I already got Roger "subtly suggesting" all over the place that customers reject my answers and Andrewyu shouting "thank you!" and gracing my answer with a D...
ASKER
Yeah, but you aren't in it for the points.... right?
Right. But sometimes the attitudes of some (or the terminal stupidity of others) get to me...
R U sure you want to waste points on that?