avatar

Andres Jaimes

Creating a simple static library

This article describes how to create a simple static library using C++. A static library is a collection of object files that are linked with and copied into a target application at compile time. The resulting executable contains all the object code from the static library, so it can be executed independently of the library. Static library Let’s start by creating a simple square class: // src/square.h #ifndef SQUARE_H #define SQUARE_H class square { private: double length; public: square(double length); double area(); }; #endif and its corresponding implementation:

Creating a simple dynamic library

This article describes how to create a simple shared library using C++. A shared library is a collection of object files that are linked with and loaded into a target application at runtime. The resulting executable contains only the object code that is needed to load the shared library, for this reason, the library has to be distributed with the executable. Shared library Let’s start by creating a simple sum.c program using C.

How many bytes does an "int" have in c++?

Well, that depends on several things, like your current processor and compiler. The best way to know it, is by using the sizeof operator. Copy the following code, compile it and run it: #include <iostream> using namespace std; int main() { cout << "char: " << sizeof(char) << endl; cout << "int: " << sizeof(int) << endl; cout << "long: " << sizeof(long) << endl; return 0; } Happy coding…

Where does Windows Live Writer store themes

Windows Live Writer makes a local copy of your website images and style sheets everytime you click on the Update Theme button located in the Blog Account ribbon. You can find your local CSS file(s) in the following folder on Windows 7: C:UsersYour NameAppDataRoamingWindows Live Writerblogtemplates If you only have one blog, you are lucky. Get into the only folder you find there. If you have many blogs it will be a trial and error process to find out the right folder where your CSS files are located.

How to install the C++ Boost Libraries on Windows

Boost is a set of high-quality libraries that speed up C++ development. They are included in most linux distributions and some of them are already part of the C++ Standard Library. In the Windows environment, you have to install them in order to take advantage of them. If you are using Microsoft Visual Studio, you can avoid the following steps by downloading a binary version from http://www.boostpro.com/download/and skip to the Testing section in this document.

Installing gcc/g++ using MinGW and NetBeans in Windows

C and C++ languages are everywhere. All operating systems use them. People usually choose them because of their limitless power, velocity of execution, great portability and much more. In this tutorial I will show you how to install a C/C++ development environment under Windows. By the way, MinGW includes other compilers for languages like c, c++, objective c fortran and ada.  Install MinGW Go to the MinGW websiteand look for the download link.

Switch from Debug to Release build options in Delphi

Unlike Microsoft’s Visual Studio, the option to switch from Debug to Release in Delphi is kind of hidden. However, it is very easy to use. Go to the Project menu and select Configuration Manager Now select your project, Choose a new configuration and Press the “play” button.  The following picture shows you how the Configuration Manager looks: By default, the difference between the Debug and the Release options include:

Working with dynamic arrays in Delphi

One advantage of Delphi’s dynamic arrays is that they are automatically freed once they go out of scope. That simplifies memory management and gives you more flexibility on your applications. You can declare a dynamic array like this: Customers: array of string;  Before adding an element, you have to call the SetLength function to specify the number of elements you are going to use (3 in this case): SetLength(Customers, 3);  Now you can go ahead adding values:

Tips to help you deal with Delphi Threads

Multithreading is one of those operating systems feaures that make your programs work in a more efficient way and give your users a better interactive interface. However they are not used by all developers. In this article I will focus on some important points you must have in mind when using threads on Delphi.  How to create them There are two simple steps to accomplish it: Create a new class that inherits from TThread and Override the Execute method.

How to manage local or remote services from command line

Starting or stopping services on Windows is a task commonly performed by using the Services snap-in on the MMC console. From time to time you want to perform such tasks from the command line. A possible reason for this is when you are creating scripts (batch files). To achieve this, you have two options: net for managing local services and sc.exe for remote ones. The net command is included in your default Windows installation.