left-hand operand of comma expression has no effect
c
Solution
This is how the comma operator works, what you want to do is to use OR or AND (probably AND in your case):
// the condition for resuming the loop is that one of the conditions is true
count < TOTAL_OBJ || packet_no < TOTAL_PKT
// the condition for resuming the loop is that both conditions are true
count < TOTAL_OBJ && packet_no < TOTAL_PKT
Problem
``` for (count = index, packet_no = 0; count < TOTAL_OBJ, packet_no < TOTAL_PKT; count++, packet_no++) ``` `=>` left-hand operand of comma expression has no effect. I find the above code is correct and could not understand why this error comes.