-
June 19th, 2009, 04:10 AM
#1
"const" problem
Hi, I have something like:
int MyInteger = 3;
int* getMyInteger()
{
return &MyInteger;
}
I'm using "int" as example... in my code I'm passing a quite complicated and huge class, so I prefer to send a pointer.
But I would like to say something like "yes, send the adreess of the variable but don't change its value" (just for security), "const" should do the job but I think it will say something like "don't change the adress of the pointer" (not the value itself).
It should be something easy to solve, but I don't find the clue. Do you know how I can do it?
thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|