Communities

Total Articles 180
No.
Subject
Author
120 The difference between global object and static object. 4 file
[Level:16]gilgil
89670   Sep 11, 2011
[StaticObject] [StaticObject.h] class StaticObject { public: static StaticObject& instance(); }; [StaticObject.cpp] StaticObject& StaticObject::instan-ce() { static StaticObject staticObject; // --- (1) --- return s...  
119 Distinguish default , explicit and copy constructor and assign operator file
[Level:16]gilgil
103443   Sep 12, 2011
[Class] class String { public: // // constructor // String() { cout << "constructor()\n"; } // default constructor String(char* p) { cout << "constructor(char*)\n"; } // explicit constructor String(const char* p)...  
118 Object parameter and Object return file
[Level:16]gilgil
76347   Sep 13, 2011
[Class] class String { public: // // constructor // String() { cout << this << "::constructor() "; } String(char* p) { cout << this << "::constructor(char*)- "; } String(const char* p) { cout << this << "::constr...  
117 Find a bug why run time error occurs. 5 file
[Level:16]gilgil
97473   Sep 13, 2011
[Quiz] Find a bug why run time error occurs. [Source] #include <iostream> #include <string> using namespace std; #define SAFE_DELETE(A) { if(A != NULL) { delete (A); A = NULL; } } class MyString { public: ...  
116 make -t file
[Level:16]gilgil
83872   Sep 23, 2011
$ g++ --version g++.exe (GCC) 4.5.2 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANT...  
115 How to add preprocessor(_DEBUG) symbol in makefile file
[Level:16]gilgil
120029   Sep 23, 2011
[makefile] CPPFLAGS+=-D_DEBUG -O0 -g all : debug_test clean: rm -rf debug_test rm -rf debug_test.exe rm -rf *.o [debug_test.cpp] #include <stdio.h> int main() { #ifdef _DEBUG printf("debug\n"); #else printf("relea...  
114 Guess the result of the following code. 1 file
[Level:16]gilgil
87451   Sep 23, 2011
[Source code] #include <iostream> #include <string> using namespace std; string foo1() { string s = "hello"; return s; } string foo2() { string s = " world"; return s; } int main() { const char* p1 = foo1().c_str(); const...  
113 Global static object dependencies problem. 2 file
[Level:16]gilgil
86403   Oct 09, 2011
[Suppose that] "Log" class is declared and used as Singleton pattern, so is "App" class. Both classes have a "instance()" method that returns their object reference. App class uses Log method(write). We ca...  
112 boost thread unit test module bug on Microsoft Visual Studio debug mode 1 file
[Level:16]gilgil
138749   Oct 11, 2011
[Environment] Microsoft Windows 7 Microsoft Visual Studio 2005 version 8.0.50727.42 (RTM.050727-4200) boost 1.47.0 [Test case] When running in release mode, no error occurs. On the other hand, in ...  
111 When is the object VMT pointer changed in constructor and destructor? 3 file
[Level:16]gilgil
107123   Oct 12, 2011
[Question] Suppose that C is inherited from B and B is inherited from A. Each class has virtual function(destructor and foo). This means that all classed have their own VMT(VMT for A, VMT for B...  
110 boost library link test in mingw file
[Level:16]gilgil
79955   Oct 14, 2011
[mingw version] [g++ version] $ g++ --version g++.exe (GCC) 4.5.2 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warran...  
109 Compiler Directive
[Level:16]gilgil
84732   Oct 17, 2011
/ ---------------------------------------------------------------------------- // Compiler Version // ---------------------------------------------------------------------------- /* __BORLANDC__ 0x0520 for C++Builder 1 0x0530 for C++Builder...  
108 How to pass std::string as default parameter 1
[Level:16]gilgil
107401   Oct 18, 2011
When passing std::string is passed, object is copied through a stack. void loadFromFile(std::st-ring fileName); So, parameter is passed in reference type to prevent object copy load in the stack. void loa...  
107 How to synchronize user defined thread with Qt GUI module. file
[Level:16]gilgil
87059   Oct 21, 2011
[MyThread.h] #include <QObject> #include <boost/thread.hpp> class MyThread : public QObject { Q_OBJECT public: MyThread(); virtual ~MyThread(); public: boost::uint32_t interval; bool active; public: bool open(); bool ...  
106 Be careful when you receive return value as reference or pointer type. file
[Level:16]gilgil
78449   Oct 24, 2011
[Source] MyInt foo() { MyInt a(1000); return a; } MyInt& ref_foo() { MyInt a(2000); return a; } MyInt* ptr_foo() { MyInt a(3000); return &a; } void foo_test() { printf("\n-------- foo test --------\n"); { MyInt b ...  
105 The preferred debugger engine for debugging binaries of type 'x86-windows-msvc2008-pe-32bit' is not available. 1 imagefile
[Level:16]gilgil
158560   Nov 17, 2011
Using Qt Creator(version 2.3.1), when you build in MSVC 2008 (Qt SDK) 2008 Debug, You might meet the following message in 64bit environment. The preferred debugger engine for debugging binaries of ty...  
104 Single precision floating-point format 1 file
[Level:16]gilgil
84074   Nov 08, 2011
[Source] // // Single precision floating-point format // // http://en.wikipedia.-org/wiki/Single_prec-ision_floating-point_format // // ---------+------------------+-------------------------+--------------------------------------------------...  
103 Change qmake.conf according to your MSVC 2008
[Level:16]gilgil
85159   Nov 21, 2011
[location] C:\QtSDK\Desktop\Qt\4.7.4\msvc2008\mkspecs\win32-msvc2008\qmake.conf C:\Qt\4.7.4\mkspecs\win32-msvc2008\qmake.conf [changed] QMAKE_CC = cl QMAKE_LEX = flex QMAKE_LEXFLAGS = QMAKE_YACC = byacc QMA...  
102 voidrealms
[Level:16]gilgil
81704   Nov 28, 2011
http://www.voidrealm-s.com/  
101 C++ Permutation Template Class file
[Level:16]gilgil
91476   Jan 20, 2012
[Permutation.h] // ---------------------------------------------------------------------------- // // Permutation Template Class Library // // http://www.gilgil.ne-t // // Copyright (c) Gilbert Lee All rights reserved // // -----------------...  


XE Login