sizeof(int) is compiler dependent .. so from this line
t = (p += sizeof(int))[-1];
what we get is
if sizeof(int) = 2
[ in 16 bit systems it is 2 bytes, which is now obsolate we don't use 16 bit computer now a days]
then
t = (p += sizeof(int))[-1]
t = (p = p + 2)[-1]
t = *(p + 2 -1) = *(p+1) = address of second element i.e. 'cd'
--------
if sizeof(int) = 4 [ in 32 bit systems size of int = 4 B, we use 32 Bit systems now a days ]
then
t = (p += sizeof(int))[-1]
t = (p = p + 4)[-1]
t = *(p + 4 -1) = *(p+3) = address of forth element i.e. 'gh'.
..................
#include <stdio.h>
void f(char**);
int main()
{
char *argv[ ] = { "ab", "cd", "ef", "gh", "ij", "kl" }; // it creates character array.
// In char array address point to only starting of character array.
f(argv); // function call with base address of char array.
return 0;
}
void f(char **p) // function call comes here. here p is pointer to pointer array
{
char *t; //create pointer variable
t = (p += sizeof(int))[-1]; // t = (p = p+4 ))[-1];
// p point to "gh" starting of this char array.
// now P[-1] ; t= *(p-1); now t point to "gh" array .
printf("%s\n", t); // %s this tell to print string until % not encounter .
since every string stored end with %.
}
so it prints 'gh'