The following program gives different results when compiled using gcc compiler, and turbo C
#include<stdio.h>
#include<string.h>
void main()
{
char* c = "gatecs2017";
char* p = c;
printf( "%d", (int)strlen( c + 2[p] - 6[p] - 1 ) );
}
Somebody please explain the working of the program. Also why it generates different results?