can anyone tell me,,,,,,,
1-what is use of bit field in structure and why we use.
2-how we know our system is little endian or big endian
3-if i allocate memory using malloc then can i use delete to deallocate the memory.
Thanx
Well I'll answer the last one, you have to use free to allocate the memory from malloc, you can't use delete. It MIGHT work, but it's not correct to do it. You should use C DMA functions or C++ DMA functions, not interchange them.
#1 - it is used to allow direct access to individual bits without having to deal with bitmasking.
#2 - Assuming you are using 32-bit, write the integer 0x01020304 to a variable,
take a pointer to the value, cast it to a char pointer, and check to see if
the referenced byte is 0x01 (big endian) or 0x04 (little endian).
#3 - You should not use delete to free memory allocated by malloc even if it
works. (Likewise with new/free). To jpeg, I understand what you are
saying, but be careful of your use of the term DMA because this has
nothing to do with direct memory access.