how to copy three charaters of a string of strg2[] into strg1[]
how to copy three charaters of a string of strg2[] into strg1[]
Use a for loop and assignment, srg[i] = strg1[i]. If the two arrays aren't "in synch" with each other, use [i] and [j] to keep them working OK.
Code:strg1[0] = strg2[0]; strg1[1] = strg2[1]; strg1[2] = strg2[2];
> how to copy three charaters of a string of strg2[] into strg1[]
Tell us your approach, and ask us to validate / comment on it.
Because you've posted three "exam" questions in the last couple of hours, and all of a sudden, it looks like we're the ones passing your exam for you.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.