MySQL 对 SQL 有很多扩展,有些用起来很方便,但有一些被误用之后会有性能问题,还会有一些意料之外的副作用,比如 REPLACE INTO。比如有这样一张表:CREATE TABLE `auto` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT....
分类:
数据库 时间:
2014-10-09 18:34:17
阅读次数:
284
1、memcpy 函数用于 把资源内存(src所指向的内存区域) 复制到目标内存(dest所指向的内存区域);拷贝多少个?有一个size变量控制拷贝的字节数;函数原型:void *memcpy(void *dest, void *src, unsigned int count);使用方法:(1)能够...
分类:
其他好文 时间:
2014-10-09 16:58:17
阅读次数:
229
#include #include int main() { unsigned int x; std::stringstream ss; ss > x; // output it as a signed type std::cout (x) << std::end...
分类:
其他好文 时间:
2014-10-09 14:17:23
阅读次数:
201
我们经常会在C程序中调用malloc()函数动态分配一块连续的内存空间并使用它们。那么,这些用户空间发生的事会引发内核空间什么样的反应呢?
malloc()是一个API,这个函数在库中封装了系统调用brk。因此如果调用malloc,那么首先会引发brk系统调用执行的过程。brk()在内核中对应的系统调用服务例程为SYSCALL_DEFINE1(brk, unsigned long, brk),参数brk用来指定heap段新的结束地址,也就是重新指定mm_struct结构中的brk字段。
br...
分类:
其他好文 时间:
2014-10-09 02:09:57
阅读次数:
279
一、原型:extern void *malloc(unsigned int num_bytes);头文件:#include 或 #include (注意:alloc.h 与 malloc.h 的内容是全然一致的。)功能:分配长度为num_bytes字节的内存块说明:假设分配成功则返回指向被分配内.....
分类:
其他好文 时间:
2014-10-09 00:26:57
阅读次数:
154
#define GPIO_OFT(x) ((x) - 0x56000000)#define GPFCON (*(volatile unsigned long *)(gpio_va + GPIO_OFT(0x56000050)))static int s3c24xx_leds_open(struct....
分类:
其他好文 时间:
2014-10-08 15:08:25
阅读次数:
224
前言: 在16位环境下,int/unsignedint 占16位,long/unsigned long占32位 在32位环境下,int占32位,unsignedint占16位,long/unsigned long占32位何时需要使用: long和 int范围是[-2^31,2^31),即-...
分类:
其他好文 时间:
2014-10-08 12:09:35
阅读次数:
321
1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 int main() 8 { 9 srand(unsigned(time(0))); 10 freope...
分类:
其他好文 时间:
2014-10-07 23:53:24
阅读次数:
304
这里想说的是:代码中的关键点为用指令jmp pFunc跳转到你想要运行的函数pFunc。指令“jmp xxxx”占5个字节,代码中用了个一字节对齐的结构体structThunk,当然也能够用 unsigned char code[5]; 说还有一个关键点就是地址计算了,jmp xxxx指令用了相对跳...
分类:
编程语言 时间:
2014-10-07 18:52:13
阅读次数:
193
字符串匹配算法有很多种,最为常用的有KMP算法、普通算法。
1、普通算法:此算法是效率最低的算法,时间复杂度为O(NM)。
程序如下:
bool str_match(const char * str1, const char * str2)//O(P*T)
{
assert(str1 != NULL && str2 != NULL);
int k = 0;
for (unsigned ...
分类:
其他好文 时间:
2014-10-07 17:56:23
阅读次数:
132