/* DEMO3 same as 2 but we condense the syntax by incrementing the pointer IN the assignment statment */ #include #include #include int main() { char word[10]; char *name = malloc( 10 * sizeof(char) ); char *word_ptr=word, *name_ptr=name; /* the start of each string */ strcpy( name, "timothy" ); /* Copy "timothy" into word */ while ( *name_ptr ) *word_ptr++ = *name_ptr++; *word_ptr = '\0'; printf("my name is: %s\n", word ); free( name )`; return 0; }