Copy array's

Hello

char8 tempSched[10], schedule[10];

	for(int i = 0; i < numbOfRounds; i++)

		tempSched[i] = schedule[i];

	

	/************************************************/

	//Start SA

	/************************************************/

	newCost = getCost(numbOfRounds, numbOfTeams, 10000, &violations, tempSched, distances);

	for(counter = 0; counter <= maxC; counter++){

		oldCost = newCost;

				[..]

		move(numbOfRounds, numbOfTeams, selMove, fTeam, sTeam, fRound, sRound, tempSched);

		newCost = getCost(numbOfRounds, numbOfTeams, 10000, &violations, tempSched, distances);

		if(oldCost < newCost){

			newCost = oldCost;

			for(int i = 0; i < numbOfTeams; i++)

				tempSched[i] = schedule[i];

		}

		}

My code blocks on the tempSched[i] = schedule[i].

is this because they refer to each other? And how to avoid this? a deep copy isn’t really nice for the resources

EDIT: It only blocks when I let the loop run for +25 times. Without the tempSched[i] = schedule[i] it can run for + 8000 times.

I have no clue at all.