Implement a function that performs binary addition. Input to the function is two const strings. The function returns a string that holds the result of addition. char* binaryadd(const char* a, const char* b) { }Eg. "1001"+"101"="1110"char* binaryadd(const char* a, const Read More
posted @ 2011-08-25 13:13 清秋 Views(250) Comments(0) Diggs(0)
[代码]假设数组的首地址为 0x100,则ptr1,ptr2,ptr3的值分别为多少呢?想偷懒的同学请潜到水底看答案!由于a为数组名,即也可表示为数组首地址,即a[0]的地址,所以 a+1为a[1]的地址;答案:ptr1 = 0x104&a为类型是int[5]的指针,所以&a+1就会加上5*sizeof(int)的长度;答案:ptr2 = 0x100+5*4 = 120int(a)+1答案:ptr3 = 0x101 Read More
posted @ 2010-12-17 16:59 清秋 Views(256) Comments(0) Diggs(0)
This may help someone (including me next time I get this error, as I always forget how to fix it ;-)All of a sudden, while developing an application, it won't compile and gives:Unsupported 16 bit resource in some_form_name.dfmThis seems to happen at random, and I haven't found any pattern except t Read More
posted @ 2010-12-14 09:12 清秋 Views(518) Comments(0) Diggs(0)
题目:有一个复杂链表,其结点除了有一个m_pNext指针指向下一个结点外,还有一个m_pSibling指向链表中的任一结点或者NULL。其结点的C++定义如下: struct ComplexNode{ int m_nValue; ComplexNode* m_pNext; ComplexNode* m_pSibling;}; 下图是一个含有5个结点的该类型复杂链表。图中实线箭头表示m_pNext指... Read More
posted @ 2010-11-26 16:28 清秋 Views(203) Comments(0) Diggs(0)