NVIDIA Interview Question

Write a function to convert big endian to little endian

Interview Answer

Anonymous

May 18, 2010

uint32_t endian_convert(uint32_t bvalue) { uint32_t lval; lval = ((bvalue >>24)&0xff) | ((bvalue >8)&0xff00) | ((bvalue <<24)&0xff000000); return lval; }