dev.gamez.lv Forum Index dev.gamez.lv
Latvian Game Developers Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 

const char* un char* const

 
dev.gamez.lv Forum Index -> Programmēšana
View previous topic :: View next topic  
Author Message
Angel



Joined: 02 Jan 2005
Posts: 113
Location: Latvija

PostPosted: Tue Jul 19, 2005 8:48 pm    Post subject: const char* un char* const

Ieprieksh nebiju ieveerojis, ka const char* un char* const, nav viens un tas pats. Bet tagad gribeeju uzzinaat ko dara char* const jo par const char* it kaa buutu skaidrs...
_________________
Back to top
View user's profile Send e-mail
GiGa
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 25 Sep 2003
Posts: 887

PostPosted: Tue Jul 19, 2005 8:58 pm    Post subject:

Smalkas lietas Smile shito arii ieprieksh nezinaaju :)

Quote:

[18.5] What's the difference between "const Fred* p", "Fred* const p" and "const Fred* const p"?

You have to read pointer declarations right-to-left.
const Fred* p means "p points to a Fred that is const" — that is, the Fred object can't be changed via p.
Fred* const p means "p is a const pointer to a Fred" — that is, you can change the Fred object via p, but you can't change the pointer p itself.
const Fred* const p means "p is a const pointer to a const Fred" — that is, you can't change the pointer p itself, nor can you change the Fred object via p.


Njemts no: http://www.parashift.com/c++-faq-lite/const-correctness.html
_________________
Back to top
View user's profile Send e-mail
Angel



Joined: 02 Jan 2005
Posts: 113
Location: Latvija

PostPosted: Tue Jul 19, 2005 9:20 pm    Post subject:

baaaaaaaaaaaaa, pieleca tikai peec 4 izlasiishanas reizes Shocked
_________________
Back to top
View user's profile Send e-mail
Display posts from previous:   
dev.gamez.lv Forum Index -> Programmēšana All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group