10 2013 档案
摘要:bool _CanSwap(char* str, int start, int end) { while (start = 0; --i) { if (str[i] i; --j) { if (str[j] > str[i]) { std::swap(str[i], str[j]); _strrev(str + i + 1); return true; } } } } _strrev(str); return false;}void PermutationNoRec(char* s...
阅读全文
摘要:This topic describes how to write a move constructor and a move assignment operator for a C++ class. A move constructor enables you to implement move semantics, which can significantly improve the performance of your applications. For more information about move semantics, see Rvalue Reference Decla
阅读全文
摘要:Generated by command:clang -dM -E -x c /dev/null#define _X86_ 1#define __ATOMIC_ACQUIRE 2#define __ATOMIC_ACQ_REL 4#define __ATOMIC_CONSUME 1#define __ATOMIC_RELAXED 0#define __ATOMIC_RELEASE 3#define __ATOMIC_SEQ_CST 5#define __CHAR16_TYPE__ unsigned short#define __CHAR32_TYPE__ unsigned int#define
阅读全文
摘要:Generated by command: gcc -dM -E -x c /dev/null#define __DBL_MIN_EXP__ (-1021)#define __pentiumpro__ 1#define __UINT_LEAST16_MAX__ 65535#define __ATOMIC_ACQUIRE 2#define __FLT_MIN__ 1.17549435082228750797e-38F#define __UINT_LEAST8_TYPE__ unsigned char#define __INTMAX_C(c) c ## LL#define __CHAR_BIT__
阅读全文
摘要:转眼之间,国庆7天长假就结束了,我也全宅在了父母那里。没有网络,我就开始翻硬盘,发现了以前从看雪上下载的一些CrackMe,很久没碰这些东西了,我也只能找个简单的玩玩了。输入的字符串存储在全局变量中,调用了两个子函数,比较它们的返回值。根据name算出一个值。根据Key算出一个值。验证步骤如下:1. 输入name和key2. check_name(name) == check_key(key)则成功上面两个函数逆出的代码如下:int check_name(const char* name){ int sum = 0; while(char c = *name++) { ...
阅读全文
摘要:多个线程读写同一个shared_ptr对象需要加锁(注意分清shared_ptr对象与shared_ptr管理的对象)。MutexLock mutex;shared_ptr globalPtr;void read(){ shared_ptr localPtr; { MutexLockGuard lock(mutex); localPtr = globalPtr; } // ...}void write(){ shared_ptr newPtr(new Foo()); { MutexLockGuard lock(mut...
阅读全文
浙公网安备 33010602011771号