In article <11**********************@g14g2000cwa.googlegroups .com>,
<pa***************@gmail.com> wrote:
This gives me a direction.
Please quote some context. About every 3rd message these days gives
information on how to do that with google groups.
However if I keep such initalized character array in my program it will
consume memory whether I use them or not. In case I have lot of images
it may take substantial memory which is not desired. I would like to
initialize them when they are called for the first time in the program
and not always. Since I cannot keep them on disc seperately that is
why I asked if there is a way to bundle these images in the shared
object. ( Something like a zipfile ).
You have asked in comp.lang.c which only deals with what can be done
with portable standard C, and the answer in standard C is that all you
have is: code, dynamic memory allocation at runtime (malloc() etc),
and objects of static duration that are initialized by default to zero
at program startup time before any code executes.
Your problem is solvable by using OS-specific extensions in some
operating systems, but that's up to the OS, not up to C.
[OT]
A common UNIX approach is via dlopen(RTLD_LAZY) and dlsym().
--
"It is important to remember that when it comes to law, computers
never make copies, only human beings make copies. Computers are given
commands, not permission. Only people can be given permission."
-- Brad Templeton