Author:
Password:

strcpy is not safe as it cannot limit the number of characters to be copied. strcpy_s is safe, but it cannot deal with char*. After searching for a while, I think I need a safe string copy function to handle char* and here it is:

// Initial dstRemainChar should be sizeof(dst)-1. And manually pending 
Tag:
C
C++
0 replys / 1166 views.
Reply

In MySQL, sometime we may write
where `attrib`&1=0
It means the LSB of `attrib` is 0.
However, it is different in C, because = have a higher precedence there, and we must use (attrib&1)==0 in C.
We'd better say, for those who is used to that [= have a higher precedence than & in C], it is mo

Tag:
MySQL
C
0 replys / 1127 views.
Reply