I'm going through some interesting exercises and would like to ask a bundle of questions as I go through the problems.
Here is my first question: what is exactly the difference between:
1 2 3 4 5 6 7 8 9 10
//1.cpp
int main ()
{
int *k=0;
constint* const &i=k; //*
// and
constint * const i=k; //**
}
both compile and seem to be valid, but how exactly?. How would one in words say what * is? Is it a dereferenced constant pointer pointing to a constant?
** is just a constant pointer pointing to a constant integer. Meaning, it is also a null pointer.
Also, when one complies with g++ c- 1.cpp. Would there be any issue with the object file?
be legitimate? Does the const do anything? I would say no since after every time the function is called the function is terminated and the memory in the stack is removed. Is that correct?