Click here to Skip to main content
15,915,611 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralFlexGrid trouble Pin
Pazzuzu8-Jul-04 0:38
Pazzuzu8-Jul-04 0:38 
GeneralCHtmlView Pin
status8-Jul-04 0:35
status8-Jul-04 0:35 
GeneralRe: CHtmlView Pin
Newromancer8-Jul-04 0:58
Newromancer8-Jul-04 0:58 
GeneralRe: CHtmlView Pin
status8-Jul-04 1:54
status8-Jul-04 1:54 
GeneralAssignment Operator with const Member Variables Pin
Steve Thresher7-Jul-04 23:48
Steve Thresher7-Jul-04 23:48 
GeneralRe: Assignment Operator with const Member Variables Pin
Mike Dimmick8-Jul-04 0:47
Mike Dimmick8-Jul-04 0:47 
GeneralNo No No! Pin
Steve Thresher8-Jul-04 2:03
Steve Thresher8-Jul-04 2:03 
GeneralRe: No No No! Pin
digwizfox8-Jul-04 5:39
digwizfox8-Jul-04 5:39 
My understanding is that the only time a const member variable can be initialized is in the member initialization list of the constructor. So unless you are just trying to solve a puzzle for a class, I wouldn't try to get around this rule in professionally designed code. If the variable is const, it is const for a reason; meaning it should never change once it is initialized. Once it is initialized by the constructor, whether it be the default constructor or the copy constructor it should never be changed!! That is why it is const. If it needs to be changed then it should not be const. It is as simple as that in my mind.

Now some super programmer might reply with some crazy way of actually making it happen; but again, it is not good programming style. Const has a special meaning and to make a member variable const and then try to undo that is a bad style in my opinion. Either the variable needs to be const or it doesn't! Since const variables must be initialized in the member initialization list of the constructor anyway, there seems to be no reason why you'd ever want to copy it in the assignment operator anyway because the value would be the same for all classes anyway!

Regards,
Shawn
GeneralLock keybord and mouse Pin
Larsson7-Jul-04 23:43
Larsson7-Jul-04 23:43 
GeneralBest technique to Schedule Tasks Pin
Atif Mushtaq7-Jul-04 23:38
Atif Mushtaq7-Jul-04 23:38 
GeneralRe: Best technique to Schedule Tasks Pin
Blake Miller8-Jul-04 14:13
Blake Miller8-Jul-04 14:13 
Generalchange desktop backgroun color Pin
repekcan7-Jul-04 23:24
repekcan7-Jul-04 23:24 
GeneralRe: change desktop backgroun color Pin
Mike Dimmick8-Jul-04 0:54
Mike Dimmick8-Jul-04 0:54 
Generalthanks your help Pin
repekcan8-Jul-04 1:03
repekcan8-Jul-04 1:03 
GeneralVC++ Automation Word 2000 Error : Unable to Disable "Cntrl+C" Pin
vishalmore7-Jul-04 23:16
vishalmore7-Jul-04 23:16 
GeneralODBC API Pin
Yulianto.7-Jul-04 23:11
Yulianto.7-Jul-04 23:11 
GeneralRe: ODBC API Pin
Johan Rosengren8-Jul-04 0:24
Johan Rosengren8-Jul-04 0:24 
GeneralOnMouseMove value problem Pin
d0153030y7-Jul-04 21:48
sussd0153030y7-Jul-04 21:48 
GeneralRe: onmousemove value problem Pin
Mike Dimmick8-Jul-04 1:17
Mike Dimmick8-Jul-04 1:17 
Generalfread() with excel and powerpoint files Pin
Member 3600827-Jul-04 20:27
Member 3600827-Jul-04 20:27 
GeneralRe: fread() with excel and powerpoint files Pin
vmaltsev8-Jul-04 2:03
vmaltsev8-Jul-04 2:03 
GeneralRe: fread() with excel and powerpoint files Pin
Member 3600828-Jul-04 2:08
Member 3600828-Jul-04 2:08 
GeneralRe: fread() with excel and powerpoint files Pin
vmaltsev8-Jul-04 2:50
vmaltsev8-Jul-04 2:50 
GeneralRe: fread() with excel and powerpoint files Pin
David Crow8-Jul-04 3:17
David Crow8-Jul-04 3:17 
GeneralAbout fatal error,when using customized template class in MFC proj. Pin
bg2sc7-Jul-04 20:06
bg2sc7-Jul-04 20: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.