title: Reverse Word Wise using basics of C++
body: <p>The <strong>question</strong> Goes like this ( my code in the last )</p>
  <p>Reverse the given string word wise. That is, the last word in given string should come at 1st place, last second word at 2nd place and so on. Individual words should remain as it is.</p>
  <p><strong>Input format :</strong>
  String in a single line</p>
  <p><strong>Output format :</strong>
  Word wise reversed string in a single line</p>
  <p><strong>Constraints :</strong>
  0 &lt;= |S| &lt;= 10^7
  where |S| represents the length of string, S.</p>
  <p><strong>Sample Input 1:</strong>
  Welcome to Coding Ninjas</p>
  <p><strong>Sample Output 1:</strong>
  Ninjas Coding to Welcome</p>
  <p><strong>Sample Input 2:</strong>
  Always indent your code</p>
  <p><strong>Sample Output 2:</strong>
  code your indent Always</p>
  <p>This code is in c++:</p>
  <pre><code>void reverseStringWordWise(char input[]) 
  {
      // Length
      int count=0;
      for(int i=0; input[i]!='\0'; i++)
      {
          count++;
      }
      int len=count;
      
      //reversing the complete string
      int i=0;
      int j=len-1;
      while(i&lt;j)
      {
          char temp=input[i];
          input[i]=input[j];
          input[j]=temp;
          i++;
          j--;
      }
      
      //individual reverse
      
      
      int k=0;
      int a,b;
      for(;k&lt;len;)
      {
          for(;input[k]==' ';k++)
          {
              b=k-1;
              break;
          }
          
          while(a&lt;b)
          {
              char temp=input[a];
              input[a]=input[b];
              input[b]=temp;
          }
      }      
  }
  </code></pre>
  <p>can someone help me with the logic of reversing the individual word, c or c++ works.</p>