80 |
C++ Permutation Template Class
|
gilgil | 91759 | | Jan 20, 2012 |
[Permutation.h] // ----------------------------------------------------------------------------
//
// Permutation Template Class Library
//
// http://www.gilgil.ne-t
//
// Copyright (c) Gilbert Lee All rights reserved
//
// -----------------...
|
|
voidrealms
|
gilgil | 81906 | | Nov 28, 2011 |
http://www.voidrealm-s.com/
|
78 |
Change qmake.conf according to your MSVC 2008
|
gilgil | 85400 | | 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...
|
77 |
|
The preferred debugger engine for debugging binaries of type 'x86-windows-msvc2008-pe-32bit' is not available.
1
|
gilgil | 159576 | | 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...
|
76 |
Single precision floating-point format
1
|
gilgil | 84274 | | Nov 08, 2011 |
[Source] //
// Single precision floating-point format
//
// http://en.wikipedia.-org/wiki/Single_prec-ision_floating-point_format
//
// ---------+------------------+-------------------------+--------------------------------------------------...
|
75 |
Be careful when you receive return value as reference or pointer type.
|
gilgil | 78683 | | 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 ...
|
74 |
How to synchronize user defined thread with Qt GUI module.
|
gilgil | 87258 | | 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 ...
|
73 |
How to pass std::string as default parameter
1
|
gilgil | 107603 | | 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...
|
72 |
Compiler Directive
|
gilgil | 84928 | | Oct 17, 2011 |
/ ---------------------------------------------------------------------------- // Compiler Version // ---------------------------------------------------------------------------- /* __BORLANDC__ 0x0520 for C++Builder 1 0x0530 for C++Builder...
|
71 |
boost library link test in mingw
|
gilgil | 80233 | | 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...
|
70 |
When is the object VMT pointer changed in constructor and destructor?
3
|
gilgil | 107386 | | 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...
|
69 |
boost thread unit test module bug on Microsoft Visual Studio debug mode
1
|
gilgil | 139140 | | 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 ...
|
68 |
Global static object dependencies problem.
2
|
gilgil | 86582 | | 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...
|
67 |
Guess the result of the following code.
1
|
gilgil | 87680 | | 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...
|
66 |
Event for boost
|
gilgil | 79281 | | Sep 23, 2011 |
[Header] #include <boost/interprocess/s-ync/scoped_lock.hpp&-gt;
#include <boost/thread/conditi-on.hpp>
#include <boost/thread/mutex.h-pp>
// ----------------------------------------------------------------------------
// Event
// ---------------...
|
65 |
How to add preprocessor(_DEBUG) symbol in makefile
|
gilgil | 120347 | | 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...
|
64 |
make -t
|
gilgil | 84101 | | 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...
|
63 |
Find a bug why run time error occurs.
5
|
gilgil | 97642 | | 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:
...
|
62 |
Object parameter and Object return
|
gilgil | 76542 | | 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...
|
61 |
Distinguish default , explicit and copy constructor and assign operator
|
gilgil | 103729 | | 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)...
|