I\'m preparing some slides for an introductory C class, and I\'m trying to present good examples (and motivation) for using pointer arithmetic over array subscripting.
#include ctype.h void skip_spaces( const char **ppsz ) { const char *psz = *ppsz; while( isspace(*psz) ) psz++; *ppsz = psz; } void fn(void) { char a[]=" Hello World!"; const char *psz = a; skip_spaces( &psz ); printf("\n%s", psz); }