Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc, char *argv[]) {
- char *x = "hello"; /* string 1 */
- char *y = "world"; /* string 2 */
- int n = 3; /* number of characters to copy */
- for (int i=0; i<=n; i++) {
- if(i<n) {
- *x++ = *y++; /* equivalent of x[i] = y[i] ? */
- printf("%sn", x); /* just so I can see if something goes wrong */
- } else {
- *x++ = '