概要:};class B:public A{public:virtual void doSth(){ cout <<"I am B";}};void main(void){B b;}Result: I am B9. Write a function to convert a word from the "big-endian" format to the "little-endian" format. (15 points)void convertToLittleEndian(unsigned int *data){unsigned int temp = 0;ASSERT(data == NULL);temp = *data;*data = (((temp & 0x000000FF) << 24)| ((temp & 0x0000FF00) << 8)| ((temp & 0x00FF0000) >> 8)| ((temp & 0xFF000000) >>
叠拓测试笔试题,标签:笔试大全,http://www.88haoxue.comvoid main(void)
{
B b;
}
Result: I am B
9. Write a function to convert a word from the "big-endian" format to the "little-endian" format. (15 points)
void convertToLittleEndian(unsigned int *data)
{
unsigned int temp = 0;
ASSERT(data == NULL);
temp = *data;
*data = (((temp & 0x000000FF) << 24)
| ((temp & 0x0000FF00) << 8)
| ((temp & 0x00FF0000) >> 8)
| ((temp & 0xFF000000) >> 24));
}
10, please implement the function memcpy(void *dest, const void *src, size_t size) (15 points)
void *memcpy(void *dest, const void *src, size_t size)
{
char *pDest = dest;
char *pSrc = src;
ASSERT((dest == NULL) || (src == NULL));
while (size-- > 0)
{
*pDest++ = *pSrc++;
}
return (void *)dest;
}
更多推荐:
上一篇:测试基础笔试题
最新更新