temporary files vs malloc (in C) -


i have program generates variable amount of data has store use later. when should choose use mallod+realloc , when should choose use temporary files?

use temporary files if size of data larger virtual address space size of target system (2-3 gb on 32-bit hosts) or if it's @ least big enough put serious resource strain on system.

otherwise use malloc.

if go route of temporary files, use tmpfile function create them, since on systems never have names in filesystem , have no chance of getting left around if program terminates abnormally. people not temp file cruft microsoft office products tend leave on place. ;-)


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -