The object approach in the C++programming language

In this section, we will design and implement the abstraction of an array, using C++classes. The initial version will only support an array of elements of type int. Subsequently, with the help of templates we will expand our array to support any type of data. The first step is, to determine, what operations will support our array. Of course, It would be tempting to implement everything imaginable […]

OOP approach in C++

Recall the specification of our array in the previous section. We talked about how, that some users might need an ordered array, while most, most likely, satisfied and disordered. If we imagine, our array IntArray ordered, the implementation of such functions, as min(), max(), find(), must be different from their implementation unordered array for greater efficiency. However, […]

Dynamic memory allocation and pointers.

Before delving into object-oriented development, we have to digress about working with memory in the program on With++. We will not be able to write any complex program, not being able to allocate memory at run time and refer to it. In With++ objects can be placed or statically – in compile time, or dynamically-at runtime […]

Built-in data type “array” in C++

C++ provides built-in support for basic data types – integers and real numbers, logical values and symbols. Numeric data types can be used built-in arithmetic and logical operations: objects of numeric type can be added, subtract, multiply, sharing etc. In addition to built-in types standard C++ library provides support for the extended set of types, such, as a string and […]

File input/output in programming languages C/C++

The iostream library also supports file input/output. All operations, applicable in the standard input and output, can also be applied to files. To use the file for input or output, we need to include another header file:

Before opening the file for output, You must declare an object of type ofstream:

Check, have we to open a file, can […]

Preprocessor directives in programming languages C/C++

The header files are included in the text of the program using preprocessor directives #include. Preprocessor directives begin with “sharp” (#), which must be the first character of the string. Program, which processes these directives, called by the preprocessor (in modern compilers the preprocessor is normally part of the compiler). The #include Directive includes in the program the contents of the specified file. The file name can be specified in two ways:

If the name of the […]

What is get set in C#

These two keywords are designed to implement properties in variables. In plain language speaking to variables became properties, the terms of which, value assignment to a variable or passing the value already stored in variable (suppose). get – provides the ability to retrieve the field value(variable). set – set(variable) ie. if in your program you will apply to the property: 1. If […]