Possible Duplicate:
C/C++, can you #include a file into a string literal?
I have several data files that will be used as a strings in my program. I want to avoid the extra overhead of reading in the files at runtime.
I could hard code them all in but I much prefer to keep them in separate files.
I could included them but then I would need to enclose them with quotation marks and add "\" for every new line (and since this data is GLSL source it messes up the syntax highlighting).
Any Ideas?
Make a script to convert the files into code. Have this script executed as part of your build process. The original files are what you check into source control and edit.
精彩评论