2 ms·
There’s an if statement around the do while loop on that page, so that the do while loop also will not run if *count == 0. The code snippets for (int i =
by codetrotter 5y ago
There’s an if statement around the do while loop on that page, so that the do while loop also will not run if *count == 0.
The code snippets
for (int i = 0; i < *count; ++i) {
str[i] = 0;
}
and
if (*count > 0) {
long idx = 0;
do {
str->__data[idx] = 0;
idx += 1;
} while (idx <= *count);
}
Will produce the same changes to the string data given the same count.