In the following program how or the two while statements working, while(szTarget[targetIndex])
& while(szTarget[targetIndex])
since the their first element is initialized to zero? Zero is false and one is true so how are they getting even one iteration?
The book I'M reading also made a point of saying this:
"It is very tempting to write C++ statements such as the following":
char dash[] = " - ";
concatString(dash, szMyName);
"This doesn't work because dash is provided just enough room to store four characters. The function will undoubtedly overrun the end of the dash array." <- What do the mean by that? I thought arrays were not changable anyway so how are they running lines like szTarget[targetIndex] = szSource[sourceIndex]
in the first place, wouldn't this be editing the array szTarget[]
?