Liste des Groupes | Revenir à cl c |
On 16/04/2025 11:29, Rosario19 wrote:On Tue, 15 Apr 2025 11:30:24 +0100, bart wrote:>
for (i=0 i<=N; ++i)
>
Most such loops iterate over 0..N-1 inclusive, so would need "<". So, in
your opinion, is that <= a typo, or is the intention to iterate over
0..N inclusive (so N+1 iterations)?
>
>
(May reply to rest separately.)
the loop enter with i=0
than make i= 1..N N in the count
so would be N+1 times iterations
that are 0..N or 0,1,2,3...,N
<= is not a Typo
i not find the problem
No? What about here:
>
enum {N=10};
int A[N];
>
for (int i=0; i <= N; ++i) A[i] = i;
>
Is there still no problem? Except this will be in the middle of 1000
lines of busy code with longer identifiers and more elaborate expressions.
Les messages affichés proviennent d'usenet.