Click here to Skip to main content
15,921,716 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Difference b/w #define and const int Pin
Tim Smith12-Jul-05 3:56
Tim Smith12-Jul-05 3:56 
GeneralRe: Difference b/w #define and const int Pin
Bob Stanneveld12-Jul-05 20:36
Bob Stanneveld12-Jul-05 20:36 
GeneralBorland Support Pin
ditty grail11-Jul-05 20:47
ditty grail11-Jul-05 20:47 
GeneralPointer to const Pin
LiYS11-Jul-05 20:20
LiYS11-Jul-05 20:20 
void u(const int* cip)
{
//! *cip = 2; // Illegal -- modifies value
int i = *cip; // OK -- copies value
//! int* ip2 = cip; // Illegal: non-const
}


In the snippet above, the argument "const int* cip" is a pointer to const that is to say the thing this pointer pointed to can't be changed but the pointer can be changed right? But I don't understand why the line "int* ip2 = cip;" can't passed the compilation. Is it because after its execution the pointee can be changed through ip2?



...always look on the <blink>bright
side of life...
(Whistle)

GeneralRe: Pointer to const Pin
Bob Stanneveld11-Jul-05 20:34
Bob Stanneveld11-Jul-05 20:34 
GeneralRe: Pointer to const Pin
LiYS11-Jul-05 22:22
LiYS11-Jul-05 22:22 
GeneralRe: Pointer to const Pin
Bob Stanneveld11-Jul-05 22:27
Bob Stanneveld11-Jul-05 22:27 
GeneralRe: Pointer to const Pin
LiYS11-Jul-05 22:30
LiYS11-Jul-05 22:30 
GeneralRe: Pointer to const Pin
Nish Nishant11-Jul-05 20:36
sitebuilderNish Nishant11-Jul-05 20:36 
GeneralRe: Pointer to const Pin
MaxVampire8211-Jul-05 21:59
MaxVampire8211-Jul-05 21:59 
GeneralMy self install codes using startup folder - please comment Pin
awah11-Jul-05 18:39
awah11-Jul-05 18:39 
GeneralRe: My self install codes using startup folder - please comment Pin
Yulianto.11-Jul-05 19:20
Yulianto.11-Jul-05 19:20 
GeneralRe: My self install codes using startup folder - please comment Pin
David Crow12-Jul-05 3:15
David Crow12-Jul-05 3:15 
GeneralRe: My self install codes using startup folder - please comment Pin
awah12-Jul-05 17:11
awah12-Jul-05 17:11 
Generalopen file dialog Pin
Anonymous11-Jul-05 18:28
Anonymous11-Jul-05 18:28 
GeneralRe: open file dialog Pin
Christian Graus11-Jul-05 18:49
protectorChristian Graus11-Jul-05 18:49 
GeneralRe: open file dialog Pin
MaxVampire8211-Jul-05 21:42
MaxVampire8211-Jul-05 21:42 
GeneralRe: open file dialog Pin
David Crow12-Jul-05 3:16
David Crow12-Jul-05 3:16 
QuestionHow to print to virtual printer from Window Service Pin
Kany Nguyen11-Jul-05 18:04
Kany Nguyen11-Jul-05 18:04 
Generalabout ie(on xp) and activex document Pin
William.Wang11-Jul-05 18:02
William.Wang11-Jul-05 18:02 
GeneralMS Flexi Grid Controls Pin
Nalima Banu11-Jul-05 17:46
Nalima Banu11-Jul-05 17:46 
GeneralMFC CString Question Pin
Stephen Doty11-Jul-05 17:32
Stephen Doty11-Jul-05 17:32 
GeneralRe: MFC CString Question Pin
Nish Nishant11-Jul-05 17:45
sitebuilderNish Nishant11-Jul-05 17:45 
GeneralRe: MFC CString Question Pin
Geert van Horrik11-Jul-05 23:52
Geert van Horrik11-Jul-05 23:52 
GeneralRe: MFC CString Question Pin
Stephen Doty12-Jul-05 6:50
Stephen Doty12-Jul-05 6:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.