- 论坛徽章:
- 0
|
原问题是这样的
This question pertains to endianness.Let's say you want to write a program for comparing two strings.You have a choice of using a 32-bit byte-addressable big-endian or little-endian architecture to do this.In either case,you can pack four characters into each word of 32 bits.Which one would you choose and how will you write such a program?[Hint:Normally,you would do string comparison,one character at a time.If you can do it a word at a time instead of a character at a time,that implementation will be faster.]
我的想法是用一个int型指针指向字符串数组不就可以利用整型数组来一次比较四个字符了吗?和端序又有什么联系?
我是一个上学的学生,了解不是很深,考虑难免不成熟,还请大家帮帮忙 |
|