C for loop with integers -


i following book let c , following code has been shown being correct:

for ( < 4 ; j = 5 ; j = 0 )      printf ( "%d", ) ;  

but in turbo c gives 3 warnings:

code has no effect. possibly incorrect assignment. 'j' assigned value never used.

if book making point code allowed c standard, correct. code not violate rule of c standard, provided i , j have been declared correctly (and printf too, including #include <stdio.h>).

however, nobody write code this, because not useful. why compiler issuing warning, because code technically allowed not programmer intend.

if book claiming code useful in way, typographical error. wrong. if book has more few errors this, should discard it.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -