saving as external text vs. saving as part of project
whitch one takes more RAM or is it the same?
in case you didnt get it from the thread name whitch one of these methods would save more RAM
read data from external text file or have the same data embeded right into a header?
thanks[smile]
I'm assuming you're talking about a programming project, where you either have bunch of string literals in your code itself, or if you put all of the text into a file that you open at runtime and read from. You were a bit vague...
Putting your data into your code will mean that it is part of the executable. And at least on Win32 platforms, probably others, when you run a program, the whole executable is loaded into memory. Thus, your string literals will be in loaded in memory during the entire execution of your program, regardless of whether you are needing that data or not at any particular moment.
If you put it in a file, however, you can open the file whenever you need the info, close it when you're done, read only bits and pieces at a time, etcetera. In general, it will probably be [or at least, can be) more memory efficient and flexible.
Putting your data into your code will mean that it is part of the executable. And at least on Win32 platforms, probably others, when you run a program, the whole executable is loaded into memory. Thus, your string literals will be in loaded in memory during the entire execution of your program, regardless of whether you are needing that data or not at any particular moment.
If you put it in a file, however, you can open the file whenever you need the info, close it when you're done, read only bits and pieces at a time, etcetera. In general, it will probably be [or at least, can be) more memory efficient and flexible.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement