<p>I thought that if a c pointer pointing to a char array was incremented then it would point to the next element in that array. But when I tried this I found that I had to increment it twice. Trying the increment using sizeof(char) I found that adding the size of a char was too much so it had to be divided by two. </p>

<pre><code>#include &lt;stdio.h&gt;

int main(int argc, char * argv[]){
   char *pi;
   int i;
   pi = argv[1];
   printf("%d args.\n",argc-1);
   printf("input: ");
   for(i=0;i&lt;argc-1;i++){
      printf("%c, ",*pi);
      /*The line below increments pi by 1 char worth of bytes */
      //pi+=sizeof(pi)/2;
      /* An alternative to the above line is putting pi++ twice - why? */
      pi++;
      pi++;
   }
   printf("\n");
   return 0;
}
</code></pre>

<p>Am I doing something wrong? or am I misunderstanding the method of incrementing pointers?</p>

If you have a pointer
```
ptr
```
of type
```
T*
```
and you add
```
N
```
, then the pointer will be advanced by
```
N * sizeof (*ptr)
```
or equivalent
```
N * sizeof (T)
```
bytes. You simply forgot to dereference
```
pi
```
. So what you got with
```
sizeof (pi)
```
was the sizeof of the
```
char*
```
, but not the sizeof of a
```
char
```
. Your line was equivalent to
```
pi+=sizeof(char*)/2;
```
Pointers on your platform are 4 bytes big. Thus in effect you did
```
pi+=2;
```
. Write
```
pi+=2
```
if you want to increment 2 times. Note that
```
char
```
has an sizeof of 1 by definition. You don't need to do
```
sizeof (char)
```
, it is always 1.