question A: in the while loop we have,"*pB++ = *pA++; " to copy the contents of strB to strB, why is the entire string copied because *ptrA++ insures that it starts from the second character in the string does it not?? please explain this.questionB:the size of strB is obviously to small to accept the contents of strA yet it does, ? can some one please explain why
Code:
#include char strA[80] = "A string to be used for demonstration purposes";char strB[1];int main(void){ char *pA; // a pointer to type character char *pB; // another pointer to type character puts(strA); // show string A pA = strA; // point pA at string A */ puts(pA); // show what pA is pointing to */ pB = strB; // point pB at string B putchar('\n'); while(*pA != '\0') { //copies strA tp strB *pB++ = *pA++; } *pB = '\0'; // adds the nul terminator to strB puts(strB); return 0;}