I need help. I keep getting a Bus Error when I run my program and I've narrowed down where it occurs to the following code fragment.
px0c0 and px0c1 are type double pointers and
count_x0c0[m] and countc0 are integers. Can anyone see why this code would be giving me a Bus Error? Thanks.
// set *px0c0 and *px0c1
for(int m=0;m<data.n;m++)
{
bayes.px0c0[m]=1.0 * (count_x0c0[m]/countc0);
bayes.px0c1[m]=1.0 * (count_x0c1[m]/countc1);
}
bayes.pc0 = 1.0 * countc0 / data.N;
px0c0 and px0c1 are type double pointers and
count_x0c0[m] and countc0 are integers. Can anyone see why this code would be giving me a Bus Error? Thanks.
// set *px0c0 and *px0c1
for(int m=0;m<data.n;m++)
{
bayes.px0c0[m]=1.0 * (count_x0c0[m]/countc0);
bayes.px0c1[m]=1.0 * (count_x0c1[m]/countc1);
}
bayes.pc0 = 1.0 * countc0 / data.N;