It's very simple. Suppose you had an automatic version:
struct sname M;
and let's say that struct sname contains an integer j
you would access this as M.j, and assign to it with, e.g., M.j=10. I assume you already know this.
With the code you've given above, array semantics will work, so p is the 6th element of p, which will point to p+5*sizeof(struct sname) (in bytes). The compiler knows that p is a pointer to type struct sname so operations like p++ will use the size of the structure, so if p=1000 and sizeof(struct sname) is 10, then p++ will set p to 1010, not to 1001.
[[ So this is why I added "(in bytes)", because if you actually do p+5*sizeof(struct sname) then this will evaluate to 1000+(5*10)*10=1500. ]]
So to access the structure members just replace M with p. Assign a value with p.j=10;, just as in the automatic version. Copy this to another variable with, e.g. int x=p.j;