You have two objects, and you need to know if their respective classes have a base class/derived class relationship or if they are unrelated.
Use the dynamic_cast operator to attempt to downcast from one type to another. The result tells you about the class’s relationships.
Example presents some code for doing this.
Determining class relationships

#include <iostream>
#include <typeinfo>
using namespace Read More →

ODB is an open-source, cross-platform, and cross-database object-relational mapping (ORM) system for C++. It allows you to persist C++ objects to a relational database without having to deal with tables, columns, or SQL and without manually writing any mapping code. ODB supports MySQL, SQLite, PostgreSQL, Oracle, and Microsoft SQL Server relational databases as well Read More →

In this article we will learn to implement a One-To-One relationship between two classes. As in the previous article, at first we will try to understand the best use of a One-To-One relationship.
There might be a situation where we need to implement a relationship between a student and his registration number. In a university a Read More →

In this article we will learn to implement a Many-To-One relationship in a C# class. As in the previous two articles, we will explain the scenario where a Many-To-One relationship is relevant. Think about the situation where we want to represent a relationship between a teacher and a student. It is a very common scenario Read More →

In this article we will see how to implement a Many-To-Many relationship in a C# class. Let's explain a few scenarios where a Many-To-Many relationship is relevant.
The relationship between a Cricket match and Cricketer is one example of a Many-To-Many relationship. One Cricket match is played by many Cricketers and one Cricketer takes part in Read More →

The following macro is not quite as compact as a single-use ostringstream or boost::lexical_cast.
But if you need conversion-to-string repeatedly in your code, this macro is more elegant in use than directly handling stringstreams or explicit casting every time.
It is also very versatile, as it converts everything supported by operator <<(), even in combination.

#include <sstream>
#define SSTR( Read More →

This is a very basic MySQL++ program and it’s very self explanatory:

#include <mysql++.h>
#include <stdlib.h>

using namespace std;
using namespace mysqlpp;

int main() {
try {
Connection conn(false);
conn.connect("DB NAME", "DB HOST probably localhost", "DB USER", "DB PASS");
Read More →

The alx driver which supports Atheros AR8162/AR8162

can not be build on Centos6.x.
The driver has not yet reached the main stream and package released in does not compile for Centos.
To solve this tedious problem you need to get the original Atheros driver (from Atheros), but after they were bought by Qualcomm this can not be Read More →

Every day when I finish work, I switch off my desktop computer. When I switch it on again the following morning, I can carry on where I left off. I switch on the computer, and all of my application windows are exactly where I left them. The web browser is still showing me the webpage Read More →

1. Introduction: What is a Daemon?
2. Getting Started
3. Planning Your Daemon
3.1 What Is It Going To Do?
3.2 How Much Interaction?
4. Basic Daemon Structure
4.1 Forking The Parent Process
4.2 Changing The File Mode Mask (Umask)
4.3 Opening Logs For Writing
4.4 Creating a Unique Session ID (SID)
4.5 Changing The Working Directory
4.6 Closing Standard File Descriptors
5. Writing the Daemon Code
5.1 Read More →

The key to use mysql++ on Ubuntu system is to find where the mysql++.h head files and the .so binary files.
First install mysqlclient and mysql++ on Ubuntu:

root# apt-get install libmysqlclient-dev libmysqld-dev libmysql++-dev libmysql++-doc libmysql++3

This will install the mysql head files in /usr/include/mysql, mysql++ head files in /usr/include/mysql, and and in /usr/lib.
These are all Read More →

Because we are trying to illustrate MySQL and mSQL database access, we will focus on issues specific to MySQL and mSQL and not try to create the perfect general C++ API. In the MySQL and mSQL world, there are three basic concepts: the connection, the result set, and the rows in the result set. Read More →

In mathematics, the sieve of Eratosthenes, is a simple, ancient algorithm for finding all prime numbers up to any given limit. It does so by iteratively marking as composite (i.e. not prime) the multiples of each prime, starting with the multiples of 2.

Algorithm description
A prime number is a natural number which has exactly Read More →

1. Tasks of the Kernel
On a purely technical level, the kernel is an intermediary layer between the hardware and the software. The kernel can be regarded as an enhanced machine that, in the view of the application, abstracts the computer on a high level.
Viewing the kernel as a resource manager is justified when several programs Read More →