Some Feature Of Cpp.

coderj001 profile image Raju ・2 min read

I like to mention previously I know other programming languages like java,c, python. So my initial learning curve is very smooth and skipped a few concepts on the way.
C++ is a powerful general-purpose programming language. It can be used to develop operating systems, browsers, games, and so on. C++ supports different ways of programming like procedural, object-oriented, functional, and so on. And in cpp20 there are lots of features to cover.

Alt Text

Some feature:

  1. Template: A template is a simple and yet very powerful tool in C++. The simple idea is to pass data type as a parameter so that we don’t need to write the same code for different data types. For example, a software company may need sort() for different data types. Rather than writing and maintaining the multiple codes, we can write one sort() and pass data type as a parameter.

  2. Vector: Vectors are sequence containers representing arrays that can change in size. Just like arrays, vectors use contiguous storage locations for their elements, which means that their elements can also be accessed using offsets on regular pointers to its elements, and just as efficiently as in arrays. But unlike arrays, their size can change dynamically, with their storage being handled automatically by the container.

  3. Stringstream: A stringstream associates a string object with a stream allowing you to read from the string as if it were a stream (like cin).

  4. Preprocessor: The preprocessors are the directives, which give instructions to the compiler to preprocess the information before actual compilation starts. All preprocessor directives begin with #, and only white-space characters may appear before a preprocessor directive on a line.

  5. New: Creates and initializes objects with dynamic storage duration, that is, objects whose lifetime is not limited by the scope in which they were created.


markdown guide