Quote:
Originally Posted by ChrisV
I've never written C++, does this actually work?
For a personal project, I've gone as far as:
Code:
const Foo* const* const
which reads as "a constant pointer to a constant pointer of a constant Foo object". Sample:
Code:
#include <iostream>
class Poo {};
void print(const Poo* const* const p)
{
std::cout << p << std::endl;
}
int main()
{
Poo poo;
Poo* poo_p = &poo;
print(&poo_p);
}
In practice, you are better off using a reference to a pointer than a double pointer.