Valid pointer operations in C Pointers of same type can be assigned and can be assigned to and from generic pointer type (void *). All other assignments require a cast and are machine dependent and dubious. Pointer + integer and Pointer - integer are valid as long as the pointer is within the range of the same array; the pointer can also go one beyond the upper end of an array as long as no attempt is made to access the value pointed to. Pointer to entries of the same array can be subtracted giving an integer and can be compared using ==, <=, etc. Pointers can be compared to NULL. The contents can be evaluated, that is *pointer is valid, as long as the pointer is not NULL or of type void * and has been initialized (via address operator &, assignment or an alloc type function).