for relatively small projects, a single main file that includes all necessary code might be preferable to makefiles, headers and separate objects.
the more common way is to compile parts of the application separately into machine code objects, maintain header files with declarations for each object and then use a linker to connect the code in object files. this may save time in the development of big projects when most objects have previously been compiled and only a few have changed and need to be recompiled.
further information: wikipedia article. sqlite uses a single compilation unit. the style is similar to javascript in html without module systems where all source files and dependencies are included at the beginning of an html file before use.
floor
is slowfile_buffer = mmap(0, file_size, PROT_READ, MAP_SHARED, file_descript, 0); MD5((unsigned char*) file_buffer, file_size, result); munmap(file_buffer, file_size);
[1 2 3 1 2 3] vs [[1 2 3] [1 2 3]]
flat
if not using standard type[][] arrays
nested
easier to access because sub arrays can be iterated with a simple incremented index, without having to incorporate the sub array size in the indexing calculation
easier to use with generic array operations, for example sorting
one array and every sub array has to be allocated separately and later freed
pro:
con:
the biggest slowdown i have experienced when programming in c versus other languages comes from having to be more specific: