Intialize An Array From A File?
Hello,
I'm wondering if there's a way to be able to initialize an array directly using a binary file, e.g. if I had:-
Code:
unsigned char buffer[4096];
Is there a way of linking 4096 bytes of data from a file rather than specifying each individual byte within the source code? I've noticed that compilation time increases dramatically when I do this as the compiler has to parse each and every byte.
My current workaround is to compile the program without initializing the array, locating the array in the executable output with a hex editor and overwriting the empty space.
I don't mind if there are compiler-specific extensions that you are aware of. :)