P币2000
因为要去面试公司
而C/C++都快忘了
上来求救一下几题
1. Write a code to swap integer a, b, without temporary variable.
2. Write 3 function: a) set a bit. b) clear a bit, c) inverse a bit.
3. Write a MARCO to calculate the square of integer a.
4. Write one line expression to check if a integer is power of 2
5. Write a function to find the middle field of singled-linked list with
ou
6. Write a code to reverse the linked list. For example: [0] -> [n], [1]
->
7. Find the possible error
Int ival;
Int **p;
Ival = *p;
8. What is the possible error of below SQR function.
int SQR(volatile int *a)
{
return (*a)*(*a);
}
另外还有图片上的
http://i.imgur.com/OVd5WL7.jpg
http://i.imgur.com/3ROeg8Q.jpg
谢谢大家的解答