consts and other animals

Posted by bks on Stack Overflow See other posts from Stack Overflow or by bks
Published on 2010-06-10T13:32:39Z Indexed on 2010/06/10 13:42 UTC
Read the original article Hit count: 229

Filed under:
|
|
|
|

Hello
i have a cpp code wich i'm having trouble reading. a class B is defined
now, i understand the first two lines, but the rest isn't clear enough.
is the line "B const * pa2 = pa1" defines a const variable of type class B?
if so, what does the next line do?

B a2(2);
B *pa1 = new B(a2);
B const * pa2 = pa1;
B const * const pa3 = pa2;

also, i'm having trouble figuring out the difference between these two:

char const *cst = “abc”;
const int ci = 15;


thank you

© Stack Overflow or respective owner

Related posts about c++

Related posts about homework