It's a stupid way of doing sizeof.
p is a pointer to MyStruct so p+1 (using pointer semantics) points to the next MyStruct in memory, i.e. p+sizeof(MyStruct) in byte semantics. p+1 and p are then both cast to char* because the pointer semantics work the same way: p+1 for a char* points to p+sizeof(char) which is equivalent to p+1 in byte semantics. Subtracting p from p+1 using char* pointer semantics gives you a sizeof(char) difference between p and p+1, which is equivalent to sizeof(MyStruct).
So that whole silly complex line that you can't understand - for good reason - can be replaced with the considerably easier:
int size=sizeof(struct MyStruct);
and the programmer who wrote that nonsense should be fired.