Click here to Skip to main content
15,907,001 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to draw table? Pin
Ali Tavakol15-Jan-06 20:14
Ali Tavakol15-Jan-06 20:14 
Questionvariable, a simple suggestion to C/C++ beginner Pin
includeh1014-Jan-06 17:13
includeh1014-Jan-06 17:13 
AnswerRe: variable, a simple suggestion to C/C++ beginner Pin
El Corazon14-Jan-06 17:49
El Corazon14-Jan-06 17:49 
GeneralRe: variable, a simple suggestion to C/C++ beginner Pin
Stephen Hewitt14-Jan-06 18:03
Stephen Hewitt14-Jan-06 18:03 
GeneralRe: variable, a simple suggestion to C/C++ beginner Pin
El Corazon14-Jan-06 18:39
El Corazon14-Jan-06 18:39 
GeneralRe: variable, a simple suggestion to C/C++ beginner Pin
Shraddhan22-Jan-06 23:34
Shraddhan22-Jan-06 23:34 
Questionstructure representing file Pin
John Simon14-Jan-06 14:50
John Simon14-Jan-06 14:50 
AnswerRe: structure representing file Pin
El Corazon14-Jan-06 15:04
El Corazon14-Jan-06 15:04 
generally you do not want to store just a pointer to a string, you will want to store a string. Also unless you want to expose all that to the all the programmers, make filename, dirty, data all private. Expose a couple of functions to request a copy of or set the filename. That gets into personal preference.

I will give my reasoning for not storing a pointer only as the filename.
A) it is pointing to data outside the class (where ever the string storage was for the original call). This means you will have bugs when ever that data storage is not persistant, or force you to use global variables. In either case you find the class design controlling behavior outside of itself, which is bad news.
B) local storage just makes easier control. copy, verify, error control, manipulation of the name (filename.backup) when you want to make backup copies or working versions. It actually increases your useability of the class for future design changes/features.
C) it fits with the whole idea of object oriented, keep all your data in respect to the class inside the class, or in a friendly class. Too much interconnection/dependancy increases difficulty in understanding.

_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

QuestionHard maths problem Pin
Christian Graus14-Jan-06 12:41
protectorChristian Graus14-Jan-06 12:41 
AnswerRe: Hard maths problem Pin
Sean Cundiff14-Jan-06 14:25
Sean Cundiff14-Jan-06 14:25 
GeneralRe: Hard maths problem Pin
Christian Graus14-Jan-06 19:56
protectorChristian Graus14-Jan-06 19:56 
AnswerRe: Hard maths problem Pin
Stephen Hewitt14-Jan-06 14:35
Stephen Hewitt14-Jan-06 14:35 
GeneralRe: Hard maths problem Pin
Christian Graus14-Jan-06 19:52
protectorChristian Graus14-Jan-06 19:52 
AnswerRe: Hard maths problem Pin
Michael A. Barnhart14-Jan-06 14:36
Michael A. Barnhart14-Jan-06 14:36 
AnswerRe: Hard maths problem Pin
El Corazon14-Jan-06 14:41
El Corazon14-Jan-06 14:41 
GeneralRe: Hard maths problem Pin
Christian Graus14-Jan-06 20:05
protectorChristian Graus14-Jan-06 20:05 
Questioni need TIC TAC TOE source vc++ Pin
peyman1361814-Jan-06 10:23
peyman1361814-Jan-06 10:23 
AnswerRe: i need TIC TAC TOE source vc++ Pin
Christian Graus14-Jan-06 12:38
protectorChristian Graus14-Jan-06 12:38 
QuestionAccessing Video Files Pin
AJ12314-Jan-06 9:15
AJ12314-Jan-06 9:15 
AnswerRe: Accessing Video Files Pin
Chris Losinger14-Jan-06 9:45
professionalChris Losinger14-Jan-06 9:45 
Questionloading and displaying images Pin
Fatima Tuz Zahra13-Jan-06 19:37
Fatima Tuz Zahra13-Jan-06 19:37 
AnswerRe: loading and displaying images Pin
zubair_ahmed13-Jan-06 20:06
zubair_ahmed13-Jan-06 20:06 
GeneralRe: loading and displaying images Pin
Fatima Tuz Zahra13-Jan-06 20:25
Fatima Tuz Zahra13-Jan-06 20:25 
GeneralRe: loading and displaying images Pin
includeh1013-Jan-06 20:38
includeh1013-Jan-06 20:38 
GeneralRe: loading and displaying images Pin
Fatima Tuz Zahra13-Jan-06 20:54
Fatima Tuz Zahra13-Jan-06 20:54 

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.