NVIDIA Interview Question: Write a function to convert b... | Glassdoor

Interview Question

Senior Software Engineer Interview San Jose, CA

Write a function to convert big endian to little endian


Interview Answer

1 Answer


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

Interview Candidate on May 17, 2010

Add Answers or Comments

To comment on this, Sign In or Sign Up.