What is C++ Programming language?, History of C++, Characterstics of c++, Advantages of C++ , Data types in C++, Keywords in C++, Operators used in C++, C++ compiler, C++ online compiler, C++ map. - IT/ITes-NSQF & GK

What is C++ Programming language?, History of C++, Characterstics of c++, Advantages of C++ , Data types in C++, Keywords in C++, Operators used in C++, C++ compiler, C++ online compiler, C++ map.

What is C++ Programming language:-

                    C++ is a high-level, general-purpose programming language designed for system and application programming. It was developed by Bjarne Stroustrup in 1983 as an extension of the C programming language. C++ adds object-oriented features, such as classes and virtual functions, to C, while also providing low-level memory access and other features commonly used in system programming. It is commonly used for developing operating systems, video games, and other high-performance applications. 

For more info click here.....


History of C++ Programming language:-

                 C++ is a programming language developed by Bjarne Stroustrup in 1983. It was designed as an extension of the C programming language, with additional features such as classes and objects, which support the concept of object-oriented programming. C++ was first implemented on the DEC VAX computer and was later ported to many other platforms. It quickly gained popularity among professional programmers and is widely used today in the development of operating systems, games, and a variety of other applications. In 1985, the first commercial version of C++, C++ 1.0, was released. Since then, several updates and revisions have been made to the language, with the latest version being C++20, which was published in 2020.

Characterstics of c++ language:- 

        C++ is a high-performance, compiled programming language that is widely used for developing operating systems, games, and other high-demand applications. Some of its key characteristics include:-

1) Object-oriented:- C++ supports object-oriented programming, which is a programming paradigm that organizes data and functions into reusable objects.

2) Template meta-programming:- C++ supports template meta-programming, which is a way to write code that generates code at compile-time.

3) Support for low-level memory manipulation:- C++ allows for direct manipulation of memory, which is useful for developing systems-level software such as operating systems and device drivers.

4) C compatibility:- C++ is compatible with C, which means that C programs can be easily integrated into C++ programs.

5) Standard Template Library:- C++ has a large library of pre-written code for common tasks such as data structures and algorithms.

6) Multi-paradigm:- C++ is a multi-paradigm programming language, which means it support multiple programming styles, such as imperative, object-oriented, and functional programming.

7) Cross-platform:- C++ can be run on a variety of platforms, including Windows, Linux, and macOS.

Advantages of C++ language:- 

            Some advantages of the C++ programming language include:-

1) It is a powerful, high-performance language that is well-suited for systems programming and creating large-scale applications.

2) C++ supports object-oriented, procedural, and generic programming styles, making it a versatile language.

3) C++ has a large, active community and a wealth of libraries and frameworks available.

4) C++ has a relatively small runtime overhead and is often used for performance-critical applications.

5) C++ can be used to create high-performance games, simulations, and other graphics-intensive applications.

6) C++ is a middle-level language, it is a combination of both high-level and low-level language features.

Data types in C++ language:-

            In C++, there are several built-in data types that can be used to store different types of data. These include:-

1) Integer types: short, int, long, long long.

2) Floating-point types:- float, double

3) Character type:- char

4) Boolean type:- bool

5) Wide character type:- wchar_t

6) Integer types for fixed-width integers:- int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t

7) Enumerated types:- enum

8) C++ also allows for user-defined data types through the use of classes and structures. Additionally, C++ supports type alias and typedef for creating new names for existing types.

9) C++11 introduced new data types such as auto, decltype, and nullptr

10) C++14 and later added additional types such as std::string_view, std::optional, std::variant, std::any, and many more types in C++20.

Keywords in C++ Language:-

         C++ has several keywords that are reserved for specific uses in the language. Some common keywords include:-

auto, break, case, char, const, continue, default, do, double,  else, enum, extern, float, for, goto, if, int, long, register, return,  short, signed, sizeof, Static, struct, switch, typedef, union,  unsigned, void, volatile, while

              These are some of the more common keywords used in C++, but there are others as well. Additionally, C++11, C++14 and C++17 added some new keywords like override, final, alignas, alignof, constexpr, decltype, noexcept, nullptr, static_assert, thread_local and consteval.

Operators used in C++ language:-

              In the C++ programming language, operators are special symbols that perform specific operations on one, two, or three operands, and then return a result. There are various types of operators in C++, including:-

1) Arithmetic operators:- These operators perform basic mathematical operations, such as addition (+), subtraction (-), multiplication (*), division (/), and modulus (%).

2) Relational operators:- These operators compare two operands and return a Boolean value based on the comparison. They include > (greater than), < (less than), >= (greater than or equal to), <= (less than or equal to), == (equal to), and != (not equal to).

3) Logical operators:- These operators are used to evaluate logical expressions and return a Boolean value. They include && (and), || (or), and ! (not).

4) Bitwise operators:- These operators perform bit-level operations on operands, such as & (and), | (or), ^ (xor), ~ (not), ​<< (left shift), and >> (right shift).

5) Assignment operators:- These operators are used to assign a value to a variable, such as =, +=, -=, *=, /=, and %=.

6) Ternary operator:- This operator is a shorthand way of writing an if-else statement. It is represented by the '?' symbol.

7) sizeof operator:- This operator returns the size of a data type or variable in bytes.

8) Conditional operator:- This operator is also known as ternary operator. It takes 3 operands and used for decision making. It is represented by the ':' symbol.

C++ compiler:-

                    A C++ compiler is a program that converts C++ code, which is written in a high-level programming language, into machine code that can be executed on a computer. Some popular C++ compilers include GCC (GNU Compiler Collection), Clang, and Microsoft Visual C++. These compilers can be used on a variety of operating systems, including Windows, Linux, and macOS.

C++ online compiler:-

              There are several online compilers available for C++. Some popular options include:

1) OnlineGDB (https://www.onlinegdb.com/online_c++_compiler)

2) Repl.it (https://repl.it/languages/c++)

3) Ideone (https://ideone.com/)

4) Code::Blocks (http://www.codeblocks.org/)

5) GCC Explorer (https://gcc.godbolt.org/)

              These compilers allow you to write, run, and debug C++ code directly in your web browser. Please note that the availability of features, performance and security might vary among them.

C++ vector:-

      In C++, a vector is a dynamic array that is part of the C++ Standard Template Library (STL). It is a template class that can store a collection of elements of any type. Vectors are similar to arrays, but they can grow or shrink in size as needed.

Some common vector operations are:-

∆ Push_back() which adds an element to the end of the vector.

∆ Pop_back() which removes the last element of the vector.

∆ size() which returns the number of elements in the vector.

∆ clear() which removes all elements from the vector.

∆ insert() which inserts an element at a specific position in the vector.

∆ erase() which removes an element at a specific position or range of elements from the vector.

∆ operator[] which allows for random access to the elements of the vector.

∆ begin() and end() which return iterators to the first and last elements of the vector.

       Vectors are a very powerful and convenient container, and are widely used in C++ programming.

C++ map:-

            A C++ map is a container in the Standard Template Library (STL) that stores key-value pairs, where each key is unique. The keys are used to access the corresponding values in the map. Maps are implemented as balanced binary search trees, which means that elements in a map are sorted by their keys. The map class has the following basic functions:-

∆ insert() to insert a key-value pair.

∆ find() to find the value corresponding to a key.

∆ erase() to remove a key-value pair.

∆ clear() to remove all elements from the map.

∆ size() to get the number of elements in the map.

For more info click here......

========================

Thanks for read this Blog

========================

No comments

If you have any doubt, please let me know

अंतर्राष्ट्रीय संगठन एक दृष्टि में/ International Organizations At a Glance

अंतर्राष्ट्रीय संगठन एक दृष्टि में/ International Organizations At a Glance:-  *1. संयुक्त राष्ट्र संघ (United Nations - UNO)* • स्थापना वर...

Powered by Blogger.