What does the `sprintf()` line store value to `count` as a `char`? In the `for` loop, `for(k = 0; *(count+k); k++, j++)`, what is `*(count+k)` doing? Can any one explain it?

[![image](https://i.stack.imgur.com/1sifQ.png)](https://i.stack.imgur.com/1sifQ.png)

```cpp
char *encode(char *src)
{ 
  int rLen;
  char count[100001];
  int len = strlen(src);
  char *dest = (char *)malloc(sizeof(char)*(len*2 + 1));
  int i, j = 0, k;
  for(i = 0; i < len; i++)
  {
    dest[j++] = src[i];
    rLen = 1;     
    while(i + 1 < len && src[i] == src[i+1])
    {
      rLen++;
      i++;
    }
    sprintf(count, "%d", rLen);
    for(k = 0; *(count+k); k++, j++) //here
    { 
      dest[j] = count[k]; 
    } 
  }
  dest[j] = '\0';
  return dest;
}

int main()
{
  char str[10000];
  cin >> str;
  cout << encode(str) << endl;
  return 0;
}

```