So if I am not mistaken, this means you are declaring an array of unknown size, containing arrays of 3 elements, containing character-strings of 5 characters, right?
Well there is the issue - C is using null-determined strings, meaning a string ends with a “\n” character. So a string with 5 non-null Characters (like “Angel”) needs a size of 6.
Because you only give it a size of 5, it’s not including the null-character and thus it’s not merely printing out the last name twice, it’s printing “AngelLayla” and “Layla” because when filling the memory with data, the “L” overrode the null-character, whereas the memory after Layla got a null written there and so far is just hasn’t been overritten, despite the fact it’s outside of the reserved memory.
At least, that’s my take on it.
Please tell if increasing the size of the strings does help.