C examples for String:char array
What does the following program print? string operation
#include <stdio.h> #include <string.h> #define M1 "this is a test? " char M2[40] = "test test test."; char * M3 = "chat"; int main(void) { char words[80]; printf(M1); //w w w . j a v a2 s. c om puts(M1); puts(M2); puts(M2 + 1); strcpy(words,M2); strcat(words, " Win a toy."); puts(words); words[4] = '\0'; puts(words); while (*M3) puts(M3++); puts(--M3); puts(--M3); M3 = M1; puts(M3); return 0; }