Click here to Skip to main content
15,895,084 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Handling large numbers Pin
David Crow18-Jun-20 5:30
David Crow18-Jun-20 5:30 
GeneralRe: Handling large numbers Pin
Peter_in_278018-Jun-20 12:48
professionalPeter_in_278018-Jun-20 12:48 
QuestionHelp me - C++ Pin
Coder1122334416-Jun-20 4:05
Coder1122334416-Jun-20 4:05 
AnswerRe: Help me - C++ Pin
CPallini16-Jun-20 4:47
mveCPallini16-Jun-20 4:47 
AnswerRe: Help me - C++ Pin
Richard MacCutchan16-Jun-20 5:05
mveRichard MacCutchan16-Jun-20 5:05 
AnswerRe: Help me - C++ Pin
ZurdoDev16-Jun-20 5:26
professionalZurdoDev16-Jun-20 5:26 
GeneralRe: Help me - C++ Pin
kalberts16-Jun-20 5:49
kalberts16-Jun-20 5:49 
AnswerRe: Help me - C++ Pin
kalberts16-Jun-20 5:36
kalberts16-Jun-20 5:36 
They are equivalent. The int value is constant, cannot be modified. Now that you decalre a pointer to this type, this pointer can be set to any constant int value, but the pointer itself may be moved around freely among several constant integer values.

The difference comes when you move 'const' to the right of the asterisk:

int *const ptr = &xxx;

Now the xxx value may change, but ptr will always point to xxx. You are not allowed to move ptr to &yyy. You can consider *ptr as another way of writing xxx. Or ptr is another way of writing &xxx. You can't move xxx to refer to another variable either, so *ptr and xxx, or ptr and &xxx work the same way. You rarely need constant pointers; the address it is initialized with will serve the same purpose. But if the address expression is complex, and it is used many times, setting up a constant pointer may save both typing and improve readability (as long as a more descriptive name than "ptr" is chosen Smile | :) ).
GeneralRe: Help me - C++ Pin
Richard MacCutchan16-Jun-20 6:06
mveRichard MacCutchan16-Jun-20 6:06 
QuestionVisual Studio and Windows SDKs - need some experienced comments about SDK usage and RTLs Pin
charlieg11-Jun-20 12:44
charlieg11-Jun-20 12:44 
AnswerRe: Visual Studio and Windows SDKs - need some experienced comments about SDK usage and RTLs Pin
Richard MacCutchan11-Jun-20 21:32
mveRichard MacCutchan11-Jun-20 21:32 
AnswerRe: Visual Studio and Windows SDKs - need some experienced comments about SDK usage and RTLs Pin
Mircea Neacsu12-Jun-20 2:24
Mircea Neacsu12-Jun-20 2:24 
GeneralRe: Visual Studio and Windows SDKs - need some experienced comments about SDK usage and RTLs Pin
charlieg12-Jun-20 8:27
charlieg12-Jun-20 8:27 
GeneralRe: Visual Studio and Windows SDKs - need some experienced comments about SDK usage and RTLs Pin
Mircea Neacsu12-Jun-20 8:59
Mircea Neacsu12-Jun-20 8:59 
QuestionRecursion to normal way Pin
iNoor728-Jun-20 9:28
iNoor728-Jun-20 9:28 
AnswerRe: Recursion to normal way Pin
jeron18-Jun-20 9:47
jeron18-Jun-20 9:47 
GeneralRe: Recursion to normal way Pin
iNoor728-Jun-20 11:00
iNoor728-Jun-20 11:00 
GeneralRe: Recursion to normal way Pin
David Crow9-Jun-20 3:15
David Crow9-Jun-20 3:15 
GeneralRe: Recursion to normal way Pin
harold aptroot8-Jun-20 10:30
harold aptroot8-Jun-20 10:30 
GeneralRe: Recursion to normal way Pin
iNoor728-Jun-20 11:01
iNoor728-Jun-20 11:01 
GeneralRe: Recursion to normal way Pin
harold aptroot8-Jun-20 11:11
harold aptroot8-Jun-20 11:11 
GeneralRe: Recursion to normal way Pin
iNoor728-Jun-20 11:39
iNoor728-Jun-20 11:39 
GeneralRe: Recursion to normal way Pin
Dave Kreskowiak8-Jun-20 16:44
mveDave Kreskowiak8-Jun-20 16:44 
AnswerRe: Recursion to normal way Pin
kalberts8-Jun-20 10:38
kalberts8-Jun-20 10:38 
GeneralRe: Recursion to normal way Pin
iNoor728-Jun-20 11:03
iNoor728-Jun-20 11:03 

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.