Do I really need malloc?
问题 I understand that malloc is used to dynamically allocate memory. In my code, I have the following function that I sometimes call: int memory_get_log(unsigned char day, unsigned char date, unsigned char month){ char fileName[11]; unsigned long readItems, itemsToRead; F_FILE *file; sprintf(fileName, "%s_%u%u%u%s", "LOG", day, date, month, ".bin"); file = f_open(fileName , "r"); itemsToRead = f_filelength( fileName ); //unsigned char *fileData = (unsigned char *) malloc(itemsToRead); unsigned