background preloader


Facebook Twitter - References vs. Pointers. C++ tutorial for C users. This text shows and highlights features and basic principles of C++.

C++ tutorial for C users

It is aimed at experienced C users who wish to learn C++. You will be able to express your code using the richer C++ syntax and you will be able to read some C++ code. Though the concept is introduced and made usable, this is not a tutorial about Object Oriented Programming. You will still have to learn the spirit of OOP and the details of its implementation in C++, in order to be a true C++ programmer. If you don't have a C++ compiler at hand, maybe try to use online tools like this one: There is a new way to #include libraries (the old method still works yet the compiler complains). Using namespace std;#include <iostream> // This is a key C++ library#include <cmath> // The standard C library math.h int main (){ double a; a = 1.2; a = sin (a); cout << a << endl; return 0;} A few hints for beginners: To compile the source code file, type this command (on most open-source Unix-like boxes) in a console or terminal window: .

C++ Language Tutorial. Search: Not logged in C++ Language These tutorials explain the C++ language from its basics up to the newest features introduced by C++11.

C++ Language Tutorial

Chapters have a practical orientation, with example programs in all sections to start practicing what is being explained right away. Introduction Compilers Basics of C++ Program structure Compound data types Classes Other language features C++ Standard Library Input/Output with files Tutorials C++ LanguageAscii CodesBoolean OperationsNumerical Bases C++ Language Introduction:CompilersBasics of C++:Program structure:Compound data types:Classes:Other language features:Standard library:Input/output with files. Threads in C++ NextPreviousContents 18. Threads in C++ IBM pthread User Guide, Thread concepts, API reference and mirror site is at IBM main site QpThread Library for C++ provides object oriented framework in C++ for threads and Unix signals on top of system level threads (currently POSIX Threads) ThreadJack supports Java-like multi-thread programming model with platform independent C++ class library and here is the download-site APE is the "APE Portable Environment" and class libraries for writing portable threaded servers in C++, under UNIX (pthread) and Win32 API's.

APE provides portable class abstraction for threads, sockets, file handling, and synchronization objects. The goal of APE is to make writing threaded servers in C++ both practical and convient, even for small and simple projects, and hence simplicity and low runtime overhead are design goals Portabale Thread Lib Thread-Recyling in C++ 18.1 Threads Tutorial 18.2 Designing a Thread Class in C++ Introduction Brief Introduction To Threads. Windows API Tutorial: Using Threads. Multitasking is one of the most difficult aspects of programming.

Windows API Tutorial: Using Threads

It makes it even more important to provide a simple set of abstractions and to encapsulate it in a nice object-oriented shell. In the OO world, the natural counterpart of the thread (which is a strictly procedural abstraction) is the Active Object. An active object owns a captive thread that performs certain tasks asynchronously. This thread has access to all the internal (private) data and methods of the object. The public interface of the Active Object is available to external agents (e.g., to the main thread, or to the Windows thread carrying messages) so that they, too, can manipulate the state of the object and that of the captive thread, albeit in a very controlled and restricted manner.

Note: A more recent (and more advanced) version of ActiveObject is described in this presentation. An Active Object is built upon a framework called ActiveObject. The Thread object is a thin encapsulation of the API. Enter key boxEditor.