Dev C++ Operator

  • C++ Basics
  • C++ Object Oriented
  • C++ Advanced
C++

Dev C++ For Windows 10

Dev c++ 5.11Dev c++ download windows 10
  • C++ Useful Resources
  • Selected Reading

The increment operator ++ adds 1 to its operand, and the decrement operator -- subtracts 1 from its operand. Thus −

And similarly −

Both the increment and decrement operators can either precede (prefix) or follow (postfix) the operand. For example −

or as −

Tagged with beginners, cpp, newbies, programming. Giving the normal C operators such as +, -, ,., additional meaning when they are applied to user defined type such as class. Let's say we have created a class called counter. Sizeof operator: sizeof is a much used in the C/C programming language. It is a compile time unary operator which can be used to compute the size of its operand. The result of sizeof is of unsigned integral type which is usually denoted by sizet. Basically, sizeof operator.

When an increment or decrement is used as part of an expression, there is an important difference in prefix and postfix forms. If you are using prefix form then increment or decrement will be done before rest of the expression, and if you are using postfix form, then increment or decrement will be done after the complete expression is evaluated.

Example

Following is the example to understand this difference −

Dev C++ Operator Overloading

When the above code is compiled and executed, it produces the following result −

cpp_operators.htm