title: What is the difference between a++ and a+1?
body: <p>I was writing a small piece of code wherein I had to increment value of a variable 'j' if the condition matched. </p>
  
  <pre><code>for(int i=0;i&lt;input.length();i++){//input and base are of type string
          for(int j=0;j&lt;base.length();j++){
              if(input[i]==base[j])input[i]=base[j+1];
          }
      }
  cout&lt;&lt;input;
  </code></pre>
  
  <p>When I executed the code, for every input I got a blank string as an output. But if I used ++j instead of j+1, the code seems to work fine. What am I missing here ?
  Also, the code for j-1 as well as --j works fine. The only problem I face is with j+1. Is it something related to precedence of operators ?</p>