Answer the question
In order to leave comments, you need to log in
How to put the content of a file into a byte array at compile time?
I have an application that should show the user a long text - the text for convenient changes is stored in a file and should be inserted into an array at the compilation stage, how to do this using a macro?
Answer the question
In order to leave comments, you need to log in
the file can be turned into a string using the xxd -i binary utility, and its output can be connected to include by adding something like
unsigned char data[]=
#include "xxd_result.h"
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question