Liste des Groupes | Revenir à cl c |
On 2025-04-15, bart wrote:* Not having to write the variable 3 times (with C not always being>
able to detect if they didn't match)
This is indeed a source of errors in C nested loops. Say we have
these macros:
>
FOR (i, 0, N-1)
FOR (j, 0, i)
...
>
we are less likely to make some copy paste error like
for (i = 0; i < N; i++)
for (j = 0; j < i; i++)
...
>
Int he past, I've run into bugs in nested loops, along these lines.
In loop-heavy code, making a macro like the FOR above might not
be a bad idea.
Les messages affichés proviennent d'usenet.