Card[nCards] is one beyond the array definition. Since you allocated nCards integers, your last available value is Card[nCards-1].
WaltP
Posting Sage w/ dash of thyme
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 37
maybe line 6 should have been this: tmp = new int[nCards+1];
Ancient Dragon
Achieved Level 70
32,274 posts since Aug 2005
Reputation Points: 5,852
Solved Threads: 2,590
Skill Endorsements: 70