1.Introduction to C++ Programming Lanuage (History,Origin and Application)

Опубликовано: 27 Июль 2026
на канале: Prof. Dasari
2,805
9

C++ (pronounced cee plus plus) is a general-purpose programming language. It has imperative, object-oriented and generic programming features, while also providing the facilities for low-level memory manipulation.It is designed with a bias toward system programming (e.g., for use in embedded systems or operating system kernels), with performance, efficiency and flexibility of use as its design requirements. C++ has also been found useful in many other contexts, including desktop applications, servers (e.g. e-commerce, web search or SQL servers), performance-critical applications (e.g. telephone switches or space probes), and entertainment software.C++ is a compiled language, with implementations of it available on many platforms and provided by various organizations, including the FSF, LLVM, Microsoft and Intel.

A C++ program is structured in a specific, particular manner. C++ is a language and therefore has a grammar similar to a spoken language like English. The grammar of computer languages is usually much, much simpler than spoken languages but comes with the disadvantage of having stricter rules. Applying this structure or grammar to the language is what allows the computer to understand the program and what it is supposed to do.

The overall program has a structure, but it is also important to understand the purpose of part of that structure. By analogy, a textbook can be split into sections, chapters, paragraphs, sentences, and words (the structure), but it is also necessary to understand the overall meaning of the words, the sentences, and chapters to fully understand the content of the textbook. You can think of this as the semantics of the program.

The hash sign (#) signifies the start of a preprocessor command. The include command is a specific preprocessor command that effectively copies and pastes the entire text of the file specified between the angle brackets into the source code. In this case the file is "iostream" which is a standard file that should come with the C++ compiler. This file name is short for "input-output streams"; in short, it contains code for displaying and getting text from the user.The include statement allows a program to "include" this functionality in the program without having to literally cut and paste it into the source code every time. The iostream file is part of the C++ standard library, which provides a set of useful and commonly used functionality provided with the compiler. The "include" mechanism, however, can be used both for standard code provided by the compiler and for reusable files created by the programmer.

C++ supports the concept of namespaces. A namespace is essentially a prefix that is applied to all the names in a certain set. One way to think about namespaces is that they are like toolboxes with different useful tools. The using command tells the compiler to allow all the names in the "std" namespace to be usable without their prefix. The iostream file defines three names used in this program - cout, cin, and endl - which are all defined in the std namespace. "std" is short for "standard" since these names are defined in the standard C++ library that comes with the compiler.Without using the std namespace, the names would have to include the prefix and be written as std::cout, std::cin, and std::endl. If we continue with the toolbox example, this code would be saying, "Use the cout, cin and endl tools from the std toolbox."

The entry point of all C++ programs is the main function. This function is called by the operating system when your program is loaded.The name cout is short for "character output" and cin, correspondingly, is an abbreviation for "character input".In a typical C++ program, most function calls are of the form object.function_name(argument1, argument2), such as cin.get() in the example above (where cin is the object, get is the function name, and there are no arguments in the argument list).A block of code is defined with the { } tokens. { signifies the start of a block of code and } signifies the end.

Each statement in C++ is ended by a semicolon. This is very roughly the equivalent of a sentence in a language like English. This tells the compiler where one operation ends and the next begins.it is common to hear someone refer to a "line of C++ code". This often can actually mean a single statement rather than literally a single line of text, since most programmers prefer a style of one line of text per statement.The return keyword stops the function where it is and returns a value (the return type must match the function's type) to the calling function. Using the return keyword is mainly effective to stop the program.