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.
file_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]]
if not using standard type arrays
easier to access because sub arrays can be iterated with one incremented index and 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
used size and total allocated size can be tracked separately. the total length of active elements can be reduced but elements can also be added up to the allocated size, and the allocated size can be automatically expanded, for example with realloc.
there are multiple options for when to do resizing
manual ensure-n before usage, which resizes if necessary
no free space checks when adding
trying to add more than what was allocated for may lead to buffer overflows
the biggest slowdown i have experienced when programming in c versus other languages comes from having to be more specific: