11 2013 档案

摘要:template char (*__countof_helper(UNALIGNED _CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];#define _countof(_Array) (sizeof(*__countof_helper(_Array)) + 0) 阅读全文
posted @ 2013-11-19 19:57 avexer 阅读(168) 评论(0) 推荐(0)
摘要:bool _Permutation(char* str) { int len = strlen(str); for (int i = len - 2; i >= 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 Per... 阅读全文
posted @ 2013-11-17 19:40 avexer 阅读(172) 评论(0) 推荐(0)
摘要:首先在Java中调用C++实现的native方法,在该方法中,我又创建了一个线程,代码请见最下面。1. 如何在这个新建的线程中调用Java代码?JavaVM *g_jvm;DWORD __stdcall ThreadProc(void*) { MessageBoxA(NULL, "os thread", "demo", 0); JNIEnv *env = NULL; g_jvm->AttachCurrentThread((void**)&env, 0); jclass cls = env->FindClass("com/co 阅读全文
posted @ 2013-11-02 20:18 avexer 阅读(242) 评论(0) 推荐(0)
摘要:int Partition(int* array, int low, int high) { int pivot = array[low]; while (low = pivot) { --high; } array[low] = array[high]; while (low < high && array[low] <= pivot) { ++low; } array[high] = array[low]; } array[low] = pivot; return low;}void qsort(int* array, int l... 阅读全文
posted @ 2013-11-01 23:10 avexer 阅读(191) 评论(0) 推荐(0)