9 days later

Wrong initialization. Instead of setting one of p[1], q[1], r[1] to 1 depending on id[1], you set one of p[1], p[2], p[3].
In reality that initialization is unnecessary; you can simply start the following for-loop from i=1.
The previous calls to memset are also unnecessary. All you need is to set p[0] = q[0] = r[0] = 0. The rest will be taken care of by your for-loop.

Suggested Topics

Topic Category Replies Views Activity
Off-topic 1 86 Apr 9

Want to read more? Browse other topics in Off-topic or view latest topics.