Practice · 1 of 4
Fix: = vs ==
CHALLENGE
Difficulty: beginner+25 XP
is_full(int used, int cap) below ALWAYS returns 1 — the condition assigns instead of comparing. Fix it so it returns 1 exactly when used == cap.
``c
int is_full(int used, int cap) {
int r;
if (used = cap) r = 1; else r = 0;
return r;
}
``
Press Submit to check your solution.
Back to lesson: Practice: Warning Forensics