Hi,
I'm trying to assign an array stored in another C file to a pointer in my C program.
I keep getting the array is undefined
What is the best way of doing this?
Hi,
I'm trying to assign an array stored in another C file to a pointer in my C program.
I keep getting the array is undefined
What is the best way of doing this?
Disk space: the final frontier
Perhaps my example should help:
In one C file:
Another C file:Code:const float w[128] = {....}
What am I doing wrong?Code:float *pointer = (float *)w[0];
Disk space: the final frontier
In the c file where you want to access the array in another fileIt is best to place this in a header file included by both files though.Code:extern const float w[128]
Thanks. I thought that originally, but I wanted to avoid the use of a header file. Anyway it seems to work with the header approach. Just need to create a pointer variable to it now.
Disk space: the final frontier