Is it a good idea to include a large text variable in compiled code?

Posted by gladman on Stack Overflow See other posts from Stack Overflow or by gladman
Published on 2013-07-03T04:47:38Z Indexed on 2013/07/03 5:05 UTC
Read the original article Hit count: 124

Filed under:
|

I am writing a program that produces a formatted file for the user, but it's not only producing the formatted file, it does more.

I want to distribute a single binary to the end user and when the user runs the program, it will generate the xml file for the user with appropriate data.

In order to achieve this, I want to give the file contents to a char array variable that is compiled in code. When the user runs the program, I will write out the char file to generate an xml file for the user.

   char*  buffers = "a xml format file contents, \
                     this represent many block text \
                     from a file,...";

I have two questions.

Q1. Do you have any other ideas for how to compile my file contents into binary, i.e, distribute as one binary file.

Q2. Is this even a good idea as I described above?

© Stack Overflow or respective owner

Related posts about c++

Related posts about c