摘要:
char * strcpy(char *to, const char *from) { char *save = to; for (; (*to = *from) != '\0'; ++from, ++to); return(save); } char * strncpy ( char * dest 阅读全文
摘要:
现象:在linux下打开Windows编辑的文本文件时会出现^M 原因:把文件从一个系统移到另一个不同的系统,你就会遇到与换行相关的问题。 解决方法: 阅读全文
摘要:
预备概念: Big-Endian和Little-Endian 定义如下: 1) Little-Endian就是低位字节排放在内存的低地址端,高位字节排放在内存的高地址端。2) Big-Endian就是高位字节排放在内存的低地址端,低位字节排放在内存的高地址端。举一个例子,比如数字0x12 34 56 阅读全文
摘要:
When system requests fail, error code are returned. To understand the nature of the error these codes need to be interpreted. They are recorded in:- H 阅读全文
摘要:
在同一个钩子点下挂载的钩子函数用优先级来决定挂载函数的执行先后顺序了,钩子优先级在Linux内核中定义如下(源代码在netfilter_ipv4.h中): 阅读全文
摘要:
Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example,Given n = 3, your program should 阅读全文
摘要:
早期计算机系统的层次: 最早的计算机用机器语言编程【第一代程序设计语言,1GL】 自底向上的结构:计算机硬件-->指令集体系结构-->应用程序 用汇编语言编程【第二代程序设计语言,2GL】自底向上的结构:计算机硬件-->指令集体系结构-->操作系统-->汇编程序-->应用程序 现代计算机系统的层次: 阅读全文
摘要:
一个典型程序的转换处理过程(GCC+linux):红色为操作,黑色为生成的结果 源程序(hello.c)[文本]-->预处理【cpp】-->源程序(hello.i)[文本]-->编译(cc1)-->汇编语言程序(hello.s)[文本]-->汇编(as)-->可重定位目标程序(hello.o)[二进 阅读全文