Hi guys,
Okay, I'm a 2nd year computer science student and I'm taking my first C++ course. I have some background in program and have used C++ for graphics programming but I'm reading the first few pages of my profs notes and am already stumped!
Here's the code snippet that's causing me the distress:
The purpose of this code is to copy a string. I understand that \0 is an indicator of the end of a string in C++ but the condition of the while loop is check after incrementing i. So, from what I can tell, isn't s[i] referring to a still untouched index of the array?Code:int i = 0; do { s[i] = t[i]; i = i + 1; } while (s[i] != '\0');
Thanks,
Canadian0469