I see multiple problems with this code. To specifically answer your question about the result array ...
long double temps[10001];
long double result = 0;
long double resids[120];
for (int i = 0; i < 6; i++)
{
for (int j = 0; j < 20; j++)
{
result = 0; for (int k = 0; k < 10001; k++)
{
temps[i] = pow((x[k] - (a[i] + (0.955 - a[i])*(exp(-(b[j]) * t[k])))), 2);
result += temps[i];
}
resids[i * 20 + j] = result; }
}
I can't tell whether "result" should be reset to zero at the start of each "i" pass or each "j" pass.