Basics of C++ Programming Language YASH PAL, 27 April 202128 May 2024 If you are a developer and mainly code in the C++ programming language then you should need to learn about the basic concepts that are going to help you to enhance your coding skills. so in this tutorial, we are going to learn about the basics concepts of the C++ programming language. What is C++ programming language? C++ is a programming language that was developed by Bjarne Stroustrup to create high-performance applications. it is a high-level programming language that was first introduced in 1998 as an extension of c programming language. also, it is a cross-platform language that gives us control over the system resources and memory used by the system. let’s take a look at the versions of the C++ programming language. VersionsStandardRelease DateC++98ISO/IEC 14882:19981998-09-01C++03ISO/IEC 14882:20032003-10-16C++11ISO/IEC 14882:20112011-09-01C++14ISO/IEC 14882:20142014-12-15C++17TBC2017-01-01C++20TBC2020-01-01C++ versions with date Basics concepts of C++ programming If you want to start with the C++ programming language then you should have at least knowledge of basic concepts that are used in C++ programming language. #include – used for including a header file or source file in the program. <iostream> – used to define the standard stream objects or functions that are used to take input and print output on the screen. <cstdlib> – used to define the general-purpose functions that can help us to manage memory, allocation of memory, and generation of random numbers. <ctime> – used to manipulate the date and time information from the system to the program. std – used to declare the C++ standard library features. cin – used to read the input from the input device. cout – used to write the output on the screen. endl – used to write output on the new line. argument – it is also known as a parameter and used to pass the information to the function. break – used to exit from a loop or a statement like from switch, while, for, or do-while loop. continue – used to skip the line from execution. const – used to define a constant object. heap – used for dynamic memory allocation. exception – It is an error that occurs anomaly in the program. <fstream> – It is a class of input/output stream to operate files. integer – whole number from 0-9 and its combinations. float numbers – a real number like 1.2 string – a sequence of characters. character – a single character or symbol. Boolean – It returns either a false or true value. int – keyword used to declare the integer variable. signed – By default all the variables in C++ programming are signed. and it is used to hold negative and positive values. unsigned – It can hold only positive (+ve) values. float – keyword used to declare the floating variable. char – keyword used to declare a character variable. bool – keyword used to declare the boolean variable. array – It is a type of data structure that holds a sequence of values of the same type. pointer – used to store the address of an object. NULL – It is a constant that denotes the value 0. sizeof – used to find the size of an object in bytes. void – it does not have any value. Oops concepts in C++ programming Instance – In C++ programming, each object is called an instance of a class. Class – Class is a blueprint or combination of objects that contain variables, methods, and functions for performing a task. encapsulation – it is a technique of packing data and functions into a single component. inheritance – it is the process of accessing methods and members of one class into another class. polymorphism – It means that if we call a member function then a different function is executed depending on the type of object that invokes the functions. means we can create more than one function with the same name and can call them for different work. virtual function – it is a function or method whose behavior can be overridden within an inheriting class by a function with the same signature. abstract class – It is a class that has pure virtual functions. means the functions can only have declarations without the body. and an abstract class can only be a base class for other classes. Basic C++ Program #include <iostream> int main() { std::cout << "Hello World!" << std::endl; } Explanation #include <iostream> – It is a directive that is used to include the header file iostream. so we can use the functions that are defined in the iostream file. iostream – It is a C++ standard library header file that contains input and output functions. and these functions provide a way to get input from and output to an external system. int main() – This is a function named main. in a C++ program, there must be only one main function and it must always return a number of the int type. and the main function is called upon the execution of the program. { } – These are the curly brackets in which we can define the body of the program. from the { open curly bracket the compiler starts compiling the program and at } close curly bracket the program stops executing by the compiler. just like in the above program we are printing the Hello World! message on the screen. std – it is a namespace and :: is the scope resolution operator that allows for an object by the name within a namespace. std::count – it is the standard output stream object that is used to print the output on the screen and defined in the iostream file. std::endl – it is a special input-output stream object that is also defined in the iostream file that is used to insert the end of the line to the string. Keywords in C++ programming language alignasstructnewdeleteand_eqthisnot_eqdynamic_castbitandtrueorexplicitbreaktypeidprotectedfalsecharunsignedusingfriendclassvoidsignedinlineconstexprwhilestatic_assertmutabledecltypealignofswitchnoexceptdoasmthread_localnullptrelsebitortryor_eqexportcasetypenamepublicfloatchar16_tchar32_treturngotocomplvolatilesizeofintconst_castxorstatic_castnamespacedefaultandtemplatenotdoubleautothrowoperatorenumbooltypedefprivateexterncatchunionregisterforreinterpret_castvirtualshortifconstwchar_tstaticlongcontinuexor_eq Basic Programming C++ Tutorials Programming Tutorials Basic Programmingcomputer sciencecpp
My partner and I stumbled over here coming from a different web page and thought I should check things out. I like what I see so now i am following you. Look forward to going over your web page repeatedly.