Click here to Skip to main content
15,913,145 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralQuestion about printf("%ld", ...) Pin
George29-Feb-03 1:05
George29-Feb-03 1:05 
GeneralRe: Question about printf("%ld", ...) Pin
Tim Smith9-Feb-03 1:25
Tim Smith9-Feb-03 1:25 
GeneralRe: Question about printf("%ld", ...) Pin
George29-Feb-03 1:35
George29-Feb-03 1:35 
GeneralRe: Question about printf("%ld", ...) Pin
Gary R. Wheeler9-Feb-03 5:00
Gary R. Wheeler9-Feb-03 5:00 
GeneralRe: Question about printf("%ld", ...) Pin
Nitron9-Feb-03 9:49
Nitron9-Feb-03 9:49 
GeneralRe: Question about printf("%ld", ...) Pin
Gary R. Wheeler9-Feb-03 11:34
Gary R. Wheeler9-Feb-03 11:34 
GeneralQuestion about const int& Pin
George28-Feb-03 23:30
George28-Feb-03 23:30 
GeneralRe: Question about const int& Pin
Stephane Rodriguez.8-Feb-03 23:45
Stephane Rodriguez.8-Feb-03 23:45 
George2 wrote:
In my mind, a reference type is useful only when its value can be changed.
Am I correct?


For performance reasons, passing a reference is better since the passed object is not copy-constructed on the stack.

The combination of const and & is good, and reflects the will to produce robust code, ie the compiler will either warn or simply not compile if the API you expose is badly used by your clients.
The side effect of this is that MS changed APIs in MFC7/ATL7 and added const in some places, causing older code to either warn or not compile anymore.
GeneralRe: Question about const int& Pin
George28-Feb-03 23:49
George28-Feb-03 23:49 
GeneralRe: Question about const int& Pin
Stephane Rodriguez.9-Feb-03 0:13
Stephane Rodriguez.9-Feb-03 0:13 
GeneralRe: Question about const int& Pin
George29-Feb-03 0:33
George29-Feb-03 0:33 
GeneralRe: Question about const int& Pin
Stephane Rodriguez.9-Feb-03 0:47
Stephane Rodriguez.9-Feb-03 0:47 
GeneralRe: Question about const int& Pin
George29-Feb-03 0:58
George29-Feb-03 0:58 
GeneralRe: Question about const int& Pin
includeh109-Feb-03 0:38
includeh109-Feb-03 0:38 
GeneralRe: Question about const int& Pin
George29-Feb-03 0:41
George29-Feb-03 0:41 
GeneralRe: Question about const int& Pin
Gary R. Wheeler9-Feb-03 5:06
Gary R. Wheeler9-Feb-03 5:06 
GeneralRe: Question about const int& Pin
Jambolo9-Feb-03 22:39
Jambolo9-Feb-03 22:39 
GeneralESC closing dialog Pin
S O S8-Feb-03 23:18
S O S8-Feb-03 23:18 
GeneralRe: ESC closing dialog Pin
skaanji9-Feb-03 0:47
skaanji9-Feb-03 0:47 
GeneralRe: ESC closing dialog Pin
S O S9-Feb-03 3:22
S O S9-Feb-03 3:22 
GeneralDirectX HELP!!! Pin
Ehsan Baghaki8-Feb-03 22:15
Ehsan Baghaki8-Feb-03 22:15 
GeneralRe: DirectX HELP!!! Pin
Anonymous8-Feb-03 23:03
Anonymous8-Feb-03 23:03 
QuestionWhat means cout.precision (4)? Pin
George28-Feb-03 22:09
George28-Feb-03 22:09 
AnswerRe: What means cout.precision (4)? Pin
Mike Nordell9-Feb-03 2:07
Mike Nordell9-Feb-03 2:07 
QuestionHow to replace the system clock? Pin
dennisV8-Feb-03 21:06
dennisV8-Feb-03 21:06 

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.