- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 7346 Articles for C++
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
484 Views
C++ is a programming language developed by Bjarne Stroustrup in 1979 at Bell Labs. C++ is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features. It is a superset of C, and that virtually any legal C program is a legal C++ program. C++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX. It is a language that is −Statically typed − A programming language is said to use static typing when type checking is performed during compile-time as opposed to run-time.Compiled − A compiled ... Read More
![Govinda Sai](https://www.tutorialspoint.com/assets/profiles/13542/profile/60_86497-1512650655.jpg)
3K+ Views
The compound assignment operators are specified in the form e1 op= e2, where e1 is a modifiable l-value not of const type and e2 is one of the following −An arithmetic typeA pointer, if op is + or –The e1 op= e2 form behaves as e1 = e1 op e2, but e1 is evaluated only once.The following are the compound assignment operators in C++ −OperatorsDescription*=Multiply the value of the first operand by the value of the second operand; store the result in the object specified by the first operand./=Divide the value of the first operand by the value of the ... Read More
![Ramu Prasad](https://www.tutorialspoint.com/assets/profiles/13539/profile/60_87996-1512650215.jpg)
13K+ Views
C++ has 5 basic arithmetic operators. They are −Addition(+)Subtraction(-)Division(/)Multiplication(*)Modulo(%)These operators can operate on any arithmetic operations in C++. Let's have a look at an example −Example#include using namespace std; main() { int a = 21; int b = 10; int c ; c = a + b; cout
![Akshaya Akki](https://www.tutorialspoint.com/assets/profiles/13526/profile/60_48621-1512703980.jpg)
15K+ Views
cin is an object of the input stream and is used to take input from input streams like files, console, etc. cout is an object of the output stream that is used to show output. Basically, cin is an input statement while cout is an output statement.They also use different operators. cin uses the insertion operator( >> ) while cout uses the extraction operator(
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
137 Views
"" Outputs a newline (in the appropriate platform-specific representation, so it generates a "\r" on Windows), but std::endl does the same and flushes the stream. Usually, you don't need to flush the stream immediately and it'll just cost you performance, so, for the most part, there's no reason to use std::endl.When you want to flush the stream manually -- e.g. because you expect your output to be made visible to the user in a timely fashion -- you should use std::endl instead of writing '' to the stream (whether as an isolated character or part of a string). Read More
![Sravani S](https://www.tutorialspoint.com/assets/profiles/13538/profile/60_67753-1512711355.jpg)
16K+ Views
&& is a new reference operator defined in the C++11 standard. int&& a means "a" is an r-value reference. && is normally only used to declare a parameter of a function. And it only takes an r-value expression.Simply put, an r-value is a value that doesn't have a memory address. E.g. the number 6, and character 'v' are both r-values. int a, a is an l-value, however (a+2) is an r-value. examplevoid foo(int&& a) { //Some magical code... } int main() { int b; foo(b); //Error. An rValue reference cannot be pointed to a lValue. ... Read More
![V Jyothi](https://www.tutorialspoint.com/assets/profiles/13530/profile/60_77592-1512648869.jpg)
32K+ Views
There is a big distinction between the suffix and prefix versions of ++.In the prefix version (i.e., ++i), the value of i is incremented, and the value of the expression is the new value of i. So basically it first increments then assigns a value to the expression.In the postfix version (i.e., i++), the value of i is incremented, but the value of the expression is the original value of i. So basically it first assigns a value to expression and then increments the variable. ... Read More
![Akshaya Akki](https://www.tutorialspoint.com/assets/profiles/13526/profile/60_48621-1512703980.jpg)
3K+ Views
cout is an object of the stdout stream, while cerr is an object of the stderr stream.stdout and stderr are different streams, even though they both refer to console output by default. Redirecting (piping) one of them (e.g. program.exe >out.txt) would not affect the other.Generally, stdout ought to be used for actual program output, whereas all information and error messages should be printed to stderr, in order that if the user redirects output to a file, information messages are still printed on the screen and not to the output file.
![Krantik Chavan](https://www.tutorialspoint.com/assets/profiles/13545/profile/60_126883-1512724834.jpg)
205 Views
A friend function of a class is defined outside that class' scope but it has the right to access all private and protected members of the class. Even though the prototypes for friend functions appear in the class definition, friends are not member functions.A friend can be a function, function template, or member function, or a class or class template, in which case the entire class and all of its members are friends.To declare a function as a friend of a class, precede the function prototype in the class definition with keyword friend as follows −class Box { double ... Read More
![Fendadis John](https://www.tutorialspoint.com/assets/profiles/13534/profile/60_64028-1512539837.jpg)
603 Views
cerr and clog are both objects of the stderr stream. Following are the differences between them. You can also read about the cout object to get a clearer picture.Un-buffered standard error stream (cerr)cerr is the standard error stream which is used to output the errors. This is also an instance of theostream class. As cerr is un-buffered therefore it's used when we need to display the error message instantly. It doesn't have any buffer to store the error message and display later.Buffered standard error stream (clog)This is also an instance of ostream class and used to display errors but unlike ... Read More