|
How to restrict inheritance in C++ I want to write a class, which by itself should restrict inheritance, something like final class in java. Is it possible to write one in c++? Regards, Alamelu N ... 15 Apr 2008 09:05
Question about heritance and other aspects. Question 1.-------------------------------------------------------------------------------------------------------------------------------------------- #include <iostream> using namespace std; class B { public: int i; B() {} }; class A { public: A(B& b1) { b1.i=0; } }; class C : pu... 13 Apr 2008 23:54
Array of char pointers. If I had to say what "arr" is, I would say it is an array of pointers to chars. If so why is it intialized with strings instead of addresses? char *arr[] = { "a", "b", "c","dd", "eee" }; Also when looking at the values of the pointers (when they appear to be adjacent) they seem to decrease by at leas... 21 Apr 2008 12:29
CString bug? Hi all, I run IBM Rational Purify on this code: CString aaa; for (int i=0 ; i<100 ; i++) aaa+= "xxxxxxxxxxxxxxx\n"; aaa.Replace("\n","\r\n"); Purify issues this warnning message: UMR: Uninitialized memory read in strstr {1 occurrence} aaa.Replace("\n","\r\n"); Is this a known ... 15 Apr 2008 01:45
#pragma comment lib Hello everyone, Just want to confirm whether my understanding is correct. The statement in source file, [Code] #pragma comment(lib, "DLL1.lib") [/Code] has the same effect (as an alternative approach) of set DLL1.lib as implicit link library input in project link settings? So, we choose either one met... 13 Apr 2008 23:54
DLL vs static library I have a library build as a DLL with all the function exported like - ============= LIB_API BOOL CreateLibInstance(); LIB_API HRESULT PostRequest(string const& start, string const& end); LIB_API HRESULT LoadXMLData(LPCTSTR tszXMLFileName); LIB_API HRESULT GetTVData(); ============= but my friend told me... 13 Apr 2008 11:06
Compiler chooses conv ctor - why? Hello, In the following code conversion from class A object to class B object can be done in two ways: (1) by conversion function being member of class A (line 6); (2) by conversion constructor being member of class B (line 11). However conversion constructor is called. The sole way to make A::operator B() t... 16 Apr 2008 10:47
C function prototype Is that for Class/Object function prototype, I must define the function in header file or .cpp file. MyClass::functionA(); MyClass::functionB(); but for C function prototype, I don't have to define if it's put before the main() function the following is not needed - void stradd (char *s1, char *s2); void ... 12 Apr 2008 19:51
c++ event sink I have a function that will download XML from internet and load XML data into database. The function will take 5 - 20 minutes to finish. I heard I should use event sink (event listener) when function is finished the task, then it will notify the caller. So I am planning to create a seperate thread to do the... 16 Apr 2008 12:23
which design is better to wrap another class instance Hello everyone, Some people doubt that the design below is inferior compared to design which makes f, either Foo* or Foo&. The reason is below design will waste memory space and degrade performance by creating a new instance. I think it depends. If we really needs to wrap a new instance, I think the follo... 13 Apr 2008 02:58 |