Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
hmm... this code does not seem to have much sense.
int (*p)[COLUMNS] is not a valid C statement, maybe you mean int* p[COLUMNS], but I can't understand the next statement.
What are you trying to do?
I suppose you want to allocate a dynamic array of ROWS*COLUMNS integers, in this case malloc will allocate ROWS*COLUMNS*2, provided int has size 2 bytes in your compiler
I don't see a way to get a result of 14 byte, did they explain the calculation?
The allocated size is 2 * 4 * integer_size which is 8 * integer size, a result of 14 byte would mean an integer size of 1.75 bytes and doesn't make sense unless the array size was different.
The only alternative solution would be if integer was represented with 4 bytes (this it true in 32bit ARM based mcu in keil uVision ), in that case the result would be 8*4bytes=32 bytes.