What is a shorthand?

What is += shorthand for in C/C++?

  • Its in one of my programs for intro to programming with C and im not sure what it means.

  • Answer:

    It's a short version of a regular assignment. It's like when you do for example: n + 1 = n It can also be written as: n+=1 All you have to do is put your variable to the left and what you what to increase it by to the right. You can also do /= for division, -= for subtraction, and *= for multiplication. I'll put the link in the source section so you can look at it more in detail.

J6YAKNAD7QEREG4LGQNL452UDA at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

It is the shorthand for the add operator. ex b = 1; c = 0; c = c + b; is the same as b = 1 c = 0; c += b; //adds b to c It's actually in all coding languages.

Io amo la musica!

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.