A const pointer question

T

Tony Johansson

Hello Experts!


I do know what this expression mean const Student stud;
I do also know what this expression const int* i ;
But I don't know what this expression mean const Student* stud;

If you like give some examples.

Many thanks

//Tony
 
R

Rolf Magnus

Tony said:
Hello Experts!


I do know what this expression mean const Student stud;
I do also know what this expression const int* i ;
But I don't know what this expression mean const Student* stud;

It means the same as the one before, with just the type int replaced by
Student, i.e. it points to an instance of type Student, and that instance
can't be modified through the pointer. What's unclear about that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top