What is the cleanest way to enable and access binary data in VC ++ Express?

I have several binaries that I would like to embed in a dll that I compile using VC ++ Express Edition.

I have several ways to do this (for example, converting data into arrays, which I compile with the code), but I'm not satisfied, and I feel like I probably miss a simple and simple solution.

What is the cleanest and easiest way to do this?

+5
source share
2 answers

I don't know if this is an option, but the Unix program (and probably readily available on Windows) xxdhas the ability to output the C header:

xxd -i file.bin > file.h

file.h unsigned char, , unsigned int, . , file.c, file.h :

extern unsigned char file[];
extern unsigned int file_len;

. , .

+14

, ( ), . , . , - , , .

+2

All Articles