title: Display short form of a string
body: <p>I am a beginner in C programming. I recently tried solving a simple problem to find the short form of a string. I can't understand why we are using <code>*(ptr+i-1)</code> in the program. What if I use only <code>* (ptr+i)</code>. Can anyone please tell me how this works?</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;string.h&gt;
  int main()
  {
      char sent[100];
      char *ptr;
      printf("Enter a sentence : ");
      gets(sent);
  
      char len=strlen(sent);
      printf("%c",*sent);
      ptr=&amp;sent;
      for(int i=1; i&lt;len; i++)
      {
          if(*(ptr+i-1) == ' ')
          {
              printf(" %c",*(ptr+i));
          }
      }
      return 0;
  }
  </code></pre>