
C/C++
lunar521
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
产生随机数
//设置随即种子srand((unsigned)time(NULL))// 范围[range_min,range_max) (double)rand() / (RAND_MAX + 1) * (range_max - range_min) + range_min;[range_min,range_max]1. (double)rand() / (RAND_M原创 2012-02-21 20:42:12 · 308 阅读 · 0 评论 -
system info & cpu core id & thread active
//1. get core idunsigned char get_real_core_id(){#ifdef _WIN64 int temp[4] = {0x0}; __cpuid(temp, 1); return (unsigned char)((temp[1]>>24)&0xff);#else unsigned int ebx_value = 0; __原创 2012-03-22 22:20:00 · 567 阅读 · 0 评论 -
copy memory & release array
// 1. copy memory/// allocates memory and copy from source array/// \param dst Destination/// \param src Source/// \param numT number of array elementstemplate void DeepCopy(T** dst, con原创 2012-03-22 22:29:28 · 300 阅读 · 0 评论