Hello,
I have observed a data access misaligned address violation during the following data type casting.
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
float mul[19013];
unsigned int ch_sz=76052, i;
mul[0]=0;
for(i=1; i<(ch_sz/4); i++)
{
mul[i]=mul[i-1]+(1/(float)(ch_sz/4));
printf("%f\t", mul[i]);
}
return 0;
}
Please help me isolate the issue and address the data alignment violation. I believe the possible reason could be that unsigned int data type is 16 bits and the float data type is 32 bits, and hence could be creating problems, but I'm not completely sure. If so, could anyone suggest a work around the issue.
Thank you.