Is c ++ better than c without STL

Articles on C and C ++

A series of articles that address various practical aspects of the C and C ++ programming languages. They were originally written for the (no longer existing) C / C ++ portal by meOme.

language

Polymorphism and heterogeneous containers
Storing objects of different types in a single container is not trivial. The article shows the correct procedure.

Performance tuning
If the program execution is excruciatingly slow, then a tuning of the performance is necessary. We show how this is possible using simple C ++ on-board tools.

Namespaces
The active use of namespaces allows the better structuring of large software projects.

Reference counting
Reference counting combines the advantage of the automatic release of object resources with the ability to copy the object as required.

Templates (1)
Templates are a powerful tool for the effective coding of algorithms in C ++. In particular, the reusability of the code is drastically improved.

Templates (2)
The creation of class templates is explained using an algorithm for storing any objects in a stack.

Parameter transfer to functions
In C ++, parameters can be passed to functions by value, by pointer or by reference. What criteria should the programmer use to make the right choice?

Constants
The declaration of constant objects, parameters and member functions is an important component of structured programming and helps avoid errors.

The 12 most common programming mistakes
The same mistakes are made over and over again ... This list contains the twelve most common mistakes in C programming and is intended to help avoid them.

Exceptions
The handling of errors and exceptional situations using exceptions is an important part of C ++

Standard Template Library (STL)

STL container
Containers are a fundamental element of the STL. Which ones are there and how are they used?

Functors - functional objects
Functors are universally usable functional objects. They extend the concept of function pointers known from C.

STL coincidences
If chance is to play a role in program execution, the STL algorithm random_shuffle can be used.

Automatic pointer with auto_ptr
The auto_ptr template from the STL helps avoid memory leaks.

Streams (1)
Streams are the universal means of inputting and outputting data in C ++.

Streams (2) - manipulators
In order to be able to design the input and output according to their own wishes, the C ++ developer has the option of controlling the data flow using manipulators.

Streams (3) - Custom manipulators
In addition to the standard stream manipulators, the developer can define his own manipulators. The reward is code that is easier to write and easier to understand.

Streams (4) - String Streams
String streams are a universal means of converting different data formats into one another. Above all, it can be used to convert strings into their numerical equivalents, which is often required.

Vectors and Lists
The Standard Template Library (STL) contains useful container templates for the sequential storage of objects. These are much more convenient to use than the well-known (and notorious) arrays from ANSI-C.

Strings - character strings
For the C programmer, dealing with strings is an annoying and time-consuming activity. For the user of the STL under C ++, however, everything will be fine ...

Input and output of files
This article answers the questions: How can you read a file into a C ++ program? How do you write to a file? How can errors in these operations be caught?

Associative container in the STL
The most important addition to the new C ++ standard is the Standard Template Library (STL).

Multithreading

Multithreading - Introduction
Multithreading describes the ability of a program to execute several strands of activity (threads) in parallel.

Multithreading - JThreads / C ++
The development of multithreaded C ++ programs under Windows and Unix can be accomplished relatively easily with the aid of the JThreads / C ++ package.

Inter Process Communication (IPC)

Mail transfer with pipes and childs
Using a C program for sending mail, it is explained how an external program can be started using the UNIX system calls pipe (), fork () and exec () and data can be sent to this via a pipe.

Synchronization of processes
When exchanging data between independently running processes, strange results can occur due to the asynchronous access to shared resources. A synchronization of the processes through the use of locking mechanisms such as semaphores provides a remedy.

Memory mapped files
If different processes are to exchange data with each other, then memory mapped files can be used. These are files that can be displayed in the main memory of one or more processes via a system call.

Network programming part 1: Client
Creating network programs that communicate with each other via TCP / IP is relatively easy using C and the socket interface. A network client is presented that can load pages from a web server via HTTP.

Network programming part 2: Server
In principle, the development of server programs is not much more complicated than client programming. This article shows the full source code of a simple web server.

Advanced network programming
The further development of the client / server application described in the previous articles presents the programmer with a number of challenges. The best way to deal with this is to use existing solutions, for example the ADAPTIVE Communication Environment (ACE).

CORBA

CORBA
CORBA is a means for the relatively comfortable implementation of distributed software. This tutorial describes the introduction to the use of CORBA in C ++ programs.

Libraries and APIs

Directories
The POSIX libraries provide simple functions for working with the directories of the file system.

Program and surroundings
The behavior of a program can be influenced by its environment. This article explains the tools needed to do this.

C ++ afterburner
The Boost C ++ Libraries offer useful and high quality extensions for C ++.

Time calculations
What day of the week was February 1st? How many days are there until Christmas? The Standard C Library contains all the routines necessary for the calculation.

Around The World
The »Locale« functions are used to adapt the Standard C Library to country-specific conditions.

What happens on September 9th?
On September 9, 2001, an internal time counter of the Unix and Windows systems has ten digits for the first time. No problem - or is the real millennium meltdown just now?

Regular expressions
Regular expressions are a powerful tool for searching and formatting texts. They are therefore already built into programming languages ​​like Perl; the C ++ programmer can use libraries like Boost regex or pcre.

Random numbers
Again and again the programmer needs randomly generated numbers, be it to simulate a chaotic environment or to give a game an unpredictable turn. For this purpose, C provides a built-in random number generator.

Calculate with any precision
The accuracy of the arithmetic built into programming language C is limited. Only with the GNU Multiple Precision Arithmetic Library is it possible to calculate with numbers of any length.

MAC address
This entry shows two methods for determining the MAC address of a network adapter

Compilers, debuggers, IDEs

Programming C ++ with Eclipse CDT
The Eclipse C / C ++ Development Toolkit (CDT) combines the look and feel of Eclipse with the power of the GNU compiler.

Bloodshed Dev-C ++
Dev-C ++ is an integrated development environment based on the MinGW compiler system. It is subject to the GNU General Public License and is ideal for beginners in C ++ programming.

The Borland C ++ Compiler 5.5
The C ++ compiler from Borland in version 5.5 for Windows is available free of charge. How do you use it to create an executable program from C ++ code?

cygwin: GNU on Windows
The popular GNU tools, especially C and C ++ compilers, are known to every Unix user. Cygwin is the freely available port of these tools to Windows 95, 98 and NT.

LCC-Win32: The free Windows IDE
LCC-Win32 is a free C development environment for Windows 95/98 and NT.

Storage control
C and C ++ leave the management of dynamic memory to the programmer. If he makes a mistake, a usually laborious search begins. Memory debuggers help with this.

Version management

Version management
The program code changes continuously during the life cycle of a software project. Version management tools such as RCS and CVS help to keep track of things.

Version management II
The Concurrent Version System (CVS) is probably the most widely used version management tool, especially for open source projects.

Reviews

Learn C programming with the C-HowTo
This C manual is not only an introduction to the C programming language, but also gives beginners a practical understanding of programming in general.

Read: Design Patterns Explained
The book by Alan Shalloway and James R. Trott promises a »New Perspective on Object-Oriented Design«.

Read: C ++ programming by A. Willms
The book "C ++ Programming" by André Willms from the Addison Wesley publishing house is a good introduction for C developers who want to "upgrade" to C ++

Read: A textbook on C and C ++
The book "C / C ++ - From the basics to professional programming" by Ulrich Kaiser is ideal for learning the programming languages ​​C and C ++.

Read: The C # Book by Eric Gunnerson
The book "C # - The New Language for Microsoft's .NET Platform" by Eric Gunnerson is equally suitable as a textbook and reference work.