NVIDIA

  www.nvidia.com
  www.nvidia.com

Interview Question

Senior Software Engineer Interview San Jose, CA

Write a function to convert big endian to little endian

Answer

Interview Answer

1 Answer

0

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

Interview Candidate on May 17, 2010

Add Answers or Comments

To comment on this Question, Sign In with Facebook or Sign Up