DSPRelated.com
Forums

Help needed

Started by luv2design December 16, 2004
Hi All,

I need to intialize an float array[n]={<filename>};
i.e
I need float array[n]=(a,b,c,....}
These a,b,c.... should be from a file in my PC.
how do i do this in CCS.

Thanks in Advance,
Luv2design

"luv2design" <suresh_porwar@yahoo.co.in> writes:

> Hi All, > > I need to intialize an float array[n]={<filename>}; > i.e > I need float array[n]=(a,b,c,....} > These a,b,c.... should be from a file in my PC. > how do i do this in CCS.
#define FLOAT_ARRAY_COUNT float array[FLOAT_ARRAY_COUNT]; int main(int argc char* argv[]) { FILE* floatFile; floatFile = fopen("floatfile.dat", "r"); fread(array, sizeof(float), FLOAT_ARRAY_COUNT, floatFile); fclose(floatFile); . . . } -- Randy Yates Sony Ericsson Mobile Communications Research Triangle Park, NC, USA randy.yates@sonyericsson.com, 919-472-1124