Do these loops do the same thing, and if so, what do they do?:
Maybe it's incredibly obvious, and maybe I should stop programming at 4 in the morning...Code:/* assuming |str| >= 1 */ /*1*/ char *p = str; while( (*p = *++p) != '\0' ) ; /*2*/ char *p = str; while( (*p = *(p++ + 1)) != '\0' ) ; /*3*/ int i = 0; while( (str[i] = str[++i]) != '\0' ) ; /*4*/ int i; for( i = 0; str[i] != '\0'; str[i] = str[++i] ) ;