Archive for category C++

How to skip C++ access modifiers – not real code security

C++ is not a pure object oriented programming language (this topic is just another argument) but it is implementing OOP concepts. On of these concepts is encapsulation: the object hides its contents (attributes or instance variables) by making them private / protected and gives access to them through public methods (like getters and setters).

Read the rest of this entry »

, ,

No Comments

How to: Transform a Mathematical Expression from Infix Writing to Postfix Writing in C++

Postfix writing (Reverse Polish Form) was made by Polish mathematician Jan Łukasiewicz. Particularities of this form of writing mathematical expressions are presented in [...].
An algorithm for transforming a writing mathematical expressions from infix to postfix writing was developed by Edsger Dijkstra (Dijkstra Shunting Algorithm).
Read the rest of this entry »

, , , ,

1 Comment

How to: Evaluate a Mathematical Expression in Postfix Writing in C++

Postfix writing [...] is a form of representation of mathematical expressions in which arithmetic operatorsare written specified by operands.
Advantages of postfix writing over prefix and infix writing:

  • Highlights clear policy of making operations;
  • Brackets for forcing priority for implementing operators are not necessary;
  • Evaluations are easily performed by computer.

Read the rest of this entry »

, , , ,

1 Comment

How to: Implement Operations on Stack and Queue Data Structures in C++

Stack is a logical data structure, its implementation in physical memory being made by using other data structures.
The components of the stack data structure have the same data type, which means that the stack is a homogeneous data structure.
There are two basic operations with stack: adding and removal of an item.
Manner of implementation for operations is given by the discipline of access: LIFO – Last In First Out.
All adds (push) and extractions (pop) are achieved at the same end of the implementation structure, called the stack top.
Read the rest of this entry »

, , , ,

2 Comments

How to: Create a DLL – Dynamic Link Library in C++ as Visual Studio 2008 Project

Using DLL ensure productivity and/or financial gain in the software development process by reusing the source code written C++. Routines and/or programming components included in a DLL are referenced in the application without the need of their re-implementation in these applications.
Read the rest of this entry »

, , , , , , , , ,

2 Comments

How to: Optimize the Memory Space by Heap Memory Allocation in C++

Memory allocation at the applications run-time enables the use of a storage space, expressed in number of bytes, having the size of heap memory required for data storing defined by the variables. Compile-time allocation allows the reservation and use of storage space with predefined size expressed in number of bytes. In this situation, software developers must anticipate the maximum size of memory space that can be used in the application.
Read the rest of this entry »

, , , , , , , , ,

No Comments

How to: Implement Arithmetic of Pointers in C++

In C++ programming language, memory areas can be accessed indirectly through pointer type variable [...]. Also, available with a memory address, it ensures movement on memory areas from the memory address stored in the variable pointer. This is ensured by arithmetic operators and it is called arithmetic of pointers.
Read the rest of this entry »

, , , , , , , , ,

1 Comment

How to: Apply the Arithmetic of Pointers and Access the Areas of Heap Memory in C++

Areas of heap memory are accessed via variables of pointer type [...]. This kind of variable manages values of memory address type.
Arithmetic of pointers [...] involves the operators use to access the areas of heap memory. Allocating of heap memory areas is done by functions and/or operators implemented in programming language.
Read the rest of this entry »

, , , , , , , , , ,

No Comments

How to: Define and Use the Pointers Variables in C++

The pointer type variables allow the accessing of memory areas with numerical content for the management of the values which represent memory addresses. The dimension of a pointer variable depends on the processor architecture.
In the C++ programming language, the definition template of a pointer variable is:
Read the rest of this entry »

, , , , ,

2 Comments

How to: Use a DLL – Dynamic Link Library in C++ as Visual Studio 2008 Project

The usage of the programming elements included in DLL’s [...] it is made in C++ applications by respecting the rules stated below.
The usage of a DLL in the C++ programming language in the Visual Studio programming environment, it is made in the following way:

  • Create a C++ project – type: Console application;
  • Define the content for the source file which uses elements included in the DLL;
  • Create the executable file.

Read the rest of this entry »

, , , ,

4 Comments