common interface for array and pointer