C++Introduction to C++Learn C++

What Is The –> Or ++> Decrement/Increment Operator In C++?

What Is The --> Or ++> Decrement/Increment Operators In C++?

What does –> mean in C++? What does ++> mean in C++? What does –< mean in C++? What does ++< mean in C++? Is there a –> or ++> operator in C++? Let’s answer these questions.

Firstly, –> and ++> are not actually an operator in C++. In reality, they are two separate operators. We use — as a decrement operator and ++ as an increment operator. Thus, that means;

  • –> is — and > operators. That means it is the code that increments x then compares the original value using the > operator.
  • ++> is ++ and > operators. That means the code decrements x then compares the original value using the > operator.

in the same way the –< and ++< are combined operators in C++. We can also answer the questions about –< and ++< operators as below.

  • –< is — and < operators. That means it is the code that decrements x then compares the original value using the < operator.
  • ++< is ++ and < operators. That means the code decrements x then compares the original value using the < operator.

Generally, these types of questions arise when users encounter these symbols in C++ code. but once you’ve become familiar with these symbols, it will be simple to use them in building C++ applications in the C++ IDE. These are mostly seen in do-while() operations and other comparison or logic operations.

Is there an example of using –> in C++?

For example,

this code can be explained well as below,

Is there an example of how to use ++> in C++?

For the ++> example,

can be explained well as below,

Is there an example of how the –< works in C++?

Generally these kind of questions comes when users see these symbols in C++ codes. These are mostly see in do while() operations. For example,

this code can be explained as below

Is there a C++ example of how to use the ++<

For the ++< example,

can be explained as below,

What other examples of using the –> operator?

Sometimes we use –> in texts to describe menus or Object Oriented things, for example,

  • We use Project–>Options menu to setup options of the project.

Note that “–>” can be used in code inside reminders or explanations to remind something, for example,

means that x points a or x refers to a etc. Which is probably written to remind the explanation about x and a.

Consequently, there no operations like –>, ++<, –<, ++<. They are combinations of two operations in C++ 🙂

C++ Builder is the easiest and fastest C and C++ IDE for building simple or professional applications on the Windows, MacOS, iOS & Android operating systems. It is also easy for beginners to learn with its wide range of samples, tutorials, help files, and LSP support for code. RAD Studio’s C++ Builder version comes with the award-winning VCL framework for high-performance native Windows apps and the powerful FireMonkey (FMX) framework for cross-platform UIs.

There is a free C++ Builder Community Edition for students, beginners, and startups; it can be downloaded from here. For professional developers, there are Professional, Architect, or Enterprise versions of C++ Builder and there is a trial version you can download from here.

close

Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome C++ content in your inbox, every day.

We don’t spam! Read our privacy policy for more info.


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial

Free C++Builder Community Edition

About author

33+ years of coding with more than 30+ programming languages, mostly C++ on Windows, Android, Mac-OS, iOS, Linux and some other operating systems. Dr. Yilmaz Yoru was born in 1974, Eskisehir-Turkey. He graduated from the department of Mechanical Engineering of Eskisehir Osmangazi University in 1997. One year later he started to work in the same university as an assistant. He received his MSc and PhD degrees from the same department of the same university. He has married and he is a father of a son. Some of his interests are Programming, Thermodynamics, Fluid Mechanics and Artificial Intelligence. He also likes the graphical 2D & 3D design and high-end innovations.
Related posts
C++C++17Introduction to C++Language FeatureLearn C++

How To Operate On The Words In A String In C++

C++Introduction to C++Language FeatureLearn C++

What Is The Best C++ Compiler for Windows 10?

C++Language FeatureLearn C++

How To Make An MSIX Windows Installer Package

C++Introduction to C++Language FeatureLearn C++

This Is How To Compile C++ Apps On Windows

en_USEnglish