0
C:nested for problem
I have a question that if I want to nest a "for" in the condition of an "if" what syntax should I obey?(I mean that if I have n inputs and I wanna check the condition of the "if" for each input what should I do?)
1 Antwort
+ 3
You should probably do it the other way round and nest the if-statement inside of the for-loop, e.g.:
for (int i = 0; i < inputs; ++i) {
if (condition) {
// do whatever
}
}