Click here to Skip to main content
15,886,199 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C++ Plotting utility Pin
Richard Andrew x6427-Nov-13 13:10
professionalRichard Andrew x6427-Nov-13 13:10 
GeneralRe: C++ Plotting utility Pin
kpks27-Nov-13 19:06
kpks27-Nov-13 19:06 
Questionsizeof Operator Pin
Richard Andrew x6426-Nov-13 15:48
professionalRichard Andrew x6426-Nov-13 15:48 
AnswerRe: sizeof Operator Pin
«_Superman_»26-Nov-13 19:00
professional«_Superman_»26-Nov-13 19:00 
GeneralRe: sizeof Operator Pin
Richard Andrew x6427-Nov-13 8:03
professionalRichard Andrew x6427-Nov-13 8:03 
AnswerRe: sizeof Operator Pin
Erudite_Eric26-Nov-13 19:31
Erudite_Eric26-Nov-13 19:31 
GeneralRe: sizeof Operator Pin
Richard Andrew x6427-Nov-13 8:02
professionalRichard Andrew x6427-Nov-13 8:02 
AnswerRe: sizeof Operator Pin
Stefan_Lang26-Nov-13 22:20
Stefan_Lang26-Nov-13 22:20 
If there are no private members in these headers then there are none! In C++ you cannot hide the members of a class. However, the class supplied in the header may just be an interface, and the actual implementation may come from a derived class which you don't know (and don't need to know) the definition of! If the class in question has no public constructor, this is a sign that it is in fact an interface. Instead it may provide some sort of "create" function.

Here as an example for the public interface of such a library:

C++
// named message logging class
class ILog {
public:
   static ILog* createInstance(const std::string& name); // new log instance - free with delete
   virtual ~ILog() {}
   virtual void Info(const std::string& context, const std::string& message)=0;
   virtual void Warning(const std::string& context, const std::string& message)=0;
   virtual void Error(const std::string& context, const std::string& message)=0;
};


And hidden in your library, this may be the implementation class:
C++
// log implementation
class CLog : public ILog {
   std::string name_;
public:
   CLog(std::string& name) : name_(name) {} // constructor
   virtual ~CLog() {}
   virtual void Info(const std::string& context, const std::string& message);
   virtual void Warning(const std::string& context, const std::string& message);
   virtual void Error(const std::string& context, const std::string& message);
};
ILog* ILog::createInstance(const std::string& name) {
   return new CLog(name);
}

GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

GeneralRe: sizeof Operator Pin
Richard Andrew x6427-Nov-13 8:00
professionalRichard Andrew x6427-Nov-13 8:00 
GeneralRe: sizeof Operator Pin
Erudite_Eric27-Nov-13 21:35
Erudite_Eric27-Nov-13 21:35 
GeneralRe: sizeof Operator Pin
Stefan_Lang27-Nov-13 21:48
Stefan_Lang27-Nov-13 21:48 
GeneralRe: sizeof Operator Pin
Erudite_Eric28-Nov-13 6:36
Erudite_Eric28-Nov-13 6:36 
GeneralRe: sizeof Operator Pin
jschell28-Nov-13 7:13
jschell28-Nov-13 7:13 
GeneralRe: sizeof Operator Pin
Erudite_Eric28-Nov-13 22:49
Erudite_Eric28-Nov-13 22:49 
GeneralRe: sizeof Operator Pin
jschell2-Dec-13 9:39
jschell2-Dec-13 9:39 
GeneralRe: sizeof Operator Pin
Stefan_Lang28-Nov-13 20:55
Stefan_Lang28-Nov-13 20:55 
GeneralRe: sizeof Operator Pin
Erudite_Eric28-Nov-13 22:48
Erudite_Eric28-Nov-13 22:48 
GeneralRe: sizeof Operator Pin
Stefan_Lang29-Nov-13 0:05
Stefan_Lang29-Nov-13 0:05 
GeneralRe: sizeof Operator Pin
jschell2-Dec-13 9:40
jschell2-Dec-13 9:40 
Questionhow to know the process is run with admin privileges or not? Pin
Le@rner25-Nov-13 23:51
Le@rner25-Nov-13 23:51 
AnswerRe: how to know the process is run with admin privileges or not? Pin
bjdestiny26-Nov-13 0:27
professionalbjdestiny26-Nov-13 0:27 
GeneralRe: how to know the process is run with admin privileges or not? Pin
Le@rner26-Nov-13 0:37
Le@rner26-Nov-13 0:37 
AnswerRe: how to know the process is run with admin privileges or not? Pin
Richard Andrew x6426-Nov-13 6:58
professionalRichard Andrew x6426-Nov-13 6:58 
AnswerRe: how to know the process is run with admin privileges or not? Pin
«_Superman_»26-Nov-13 19:53
professional«_Superman_»26-Nov-13 19:53 
GeneralRe: how to know the process is run with admin privileges or not? Pin
Le@rner26-Nov-13 22:33
Le@rner26-Nov-13 22:33 

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.