Category : pointers

I have a little code that merge strcpy array and pointer. I don’t understand why the code display "Good exam". I see that after the line of strcpy ptr contain "lexam". So can you explain when the value of a[] change. Thanks char a[50] = "Good luck!"; char b[50] = { ‘i’,’n’,’ ‘, ‘t’,’h’,’e’,’ ‘,’e’,’x’,’a’,’m’,'{$content}’ ..

Read more

I have a little code that merge strcpy array and pointer. I don’t understand why the code displays "Good exam". I see that after the call to strcpy, ptr contains "lexam". So, can you explain when the value of a[] changes? char a[50] = "Good luck!"; char b[50] = { ‘i’,’n’,’ ‘, ‘t’,’h’,’e’,’ ‘,’e’,’x’,’a’,’m’,'{$content}’ }; ..

Read more