What is the difference between assert and verify Macros:
1 assert and verify macros work basically the same in debug mode. Both of them calculate the expression value. If the value is not 0, nothing will be done. If the value is 0, the diagnostic information is output.
2 assert and verify macros have different effects in the release mode. Assert does not calculate the expression value or output diagnostic information. Verify calculates the expression value, but does not output diagnostic information no matter whether the value is 0 or not.
Verify and assert are essentially different in program debugging.
By the way, it is worth mentioning thatVerify () Macro, which allows you to put program code in a Boolean expression. This macro is usually used to check the return values of Windows APIs. Some people may abuse verify () For this reason. In fact, this is dangerous because verify () violates the idea of assertions and cannot completely separate program code from debugging code, in the end, it may cause a lot of trouble. Therefore, experts suggest using this macro as little as possible..
The basic header file afx. h of VCPositionIs defined as follows:
Struct _ Position {};
Typedef _ Position * position
Obviously, a struct without any fields is defined here, and position is the pointer of this struct.
When VC uses clist, some functions usually use the position parameter or return the position type. In fact, you can see the original code of clist. The position returned by clist is a node pointer of its linked list, that is to say, there is a cNode class in the clist that defines the node, and the position is the cNode *
Therefore, although the _ Position struct does not have any fields, the position struct pointer is only used to express the cNode * pointer and is forcibly converted. Therefore, position is used by VC as a common data type-32-bit pointer.