假设你有两个数字,这两个符号整数,你要总结他们,但不能用你的语言的常规+和 - 运营商。你会怎么做呢?
Suppose you have two numbers, both signed integers, and you want to sum them but can't use your language's conventional + and - operators. How would you do that?
根据 http://www.ocf.berkeley.edu/~ WWU /谜语/ cs.shtml
不是我的,但可爱的
int a = 42;
int b = 17;
char *ptr = (char*)a;
int result = (int)&ptr[b];