摘要:
创建ipv4和ipv6的socket,同时监听某个端口的ipv4和ipv6报文,运行时bind函数执行失败,提示“bind: Address already in use”。原因:ipv6的socket默认情况下也会接收ipv4地址的报文,不同的socket不能监听同样的ip同样的端口。方法:设置i... 阅读全文
摘要:
题目:http://www.gowrikumar.com/c/参考:http://wangcong.org/blog/archives/291http://www.cppblog.com/smagle/archive/2010/05/27/116211.htmlhttp://blog.chinaun... 阅读全文
摘要:
第五十一题Write a C function which does the addition of two integers without using the '+' operator. You can use only the bitwise operators.(Remember the g... 阅读全文
摘要:
第四十六题What does the following macro do? #define ROUNDUP(x,n) ((x+n-1)&(~(n-1)))题目讲解:参考:http://bbs.chinaunix.net/forum.php?mod=viewthread&tid=814501用于... 阅读全文
摘要:
第三十八题What is the bug in the following program? #include #include #define SIZE 15 int main() { int *a, i; a = malloc(SIZE*sizeof(int... 阅读全文
摘要:
第三十四题The following is a piece of C code, whose intention was to print a minus sign 20 times. But you can notice that, it doesn't work. #include in... 阅读全文
摘要:
第三十一题The following is a simple C program to read and print an integer. But it is not working properly. What is(are) the mistake(s)? #include int m... 阅读全文
摘要:
第二十六题(不会)The following is a simple program which implements a minimal version of banner command available on most *nix systems. Find out the logic use... 阅读全文
摘要:
第二十一题What is the potential problem with the following C program? #include int main() { char str[80]; printf("Enter the string:"); ... 阅读全文
摘要:
第十六题The following is a small C program split across files. What do you expect the output to be, when both of them compiled together and run?File1.c ... 阅读全文