While OriginalGriff's answer already says it all, let me try to clarify some more points here.
Your first pointer assignment is perfectly legal:
Pointer ptr contains now the address of obj, hence it is pointing to obj.
Remark: Your question is somewhat unclear, probably because of language problems.This is no "reference" in the C++ sense. Perhaps you meant that ptr is now referencing object obj. Yes, one could say that.
With your static definition of obj
you have created just a single instance of obj and ptr is now pointing at it. When you now increment your pointer ptr, it will point somewhere undefined. The memory at this new location may contain just anything and by assigning data to this location you will be overwriting whatever is stored there.
This will write an integer 20 over whatever ptr is now pointing at. And most likely this will create some irratic behaviour of your program.
Perhaps you were assuming that incrementing the pointer would automatically lead to the allocation of an additional object of type s1. This is not the case. Memory space is only allocated when you define something or when you call new (or one of the malloc variants in C). By incrementing the pointer you just manipulate the pointer, nothing else.
Hope that clarifies it.