is anyone aware of a C++ equivalent of Perl's __DATA__
segment? For anyone not familiar with Perl, the __DATA__
segment is an (optional) annotation towards the end of a Perl file; whatever comes after is considered the content of a (virtual) file which can be accessed (read, written) by Perl through the DATA file handle. I'm looking for something similar to use in a C++ program (don't ask, don't tell).
Thanks
There’s nothing like that in general.
However, the Linux ELF binary format allows the inclusion of data files via the GNU tool
objcopy
.On Windows you can use resource files and assign the linker to include those in the executable.
OS X conventionally uses application bundles to achieve a similar effect.