原创 預處理

1.預處理規則 文件包含 宏定義 條件編譯2.預處理器的主要工作:  1、文件包含  2、宏定義替換  3、取捨條件編譯3.預處理通用規則 指令都以#開始 在指令的符號間可有任意數量的空格或tab 通常指令在第一個換行符處結束,末尾不出現‘

原创 五種排序算法

五種排序算法  若有數組a[N]void exchange(int *l,int *r){     int temp=*l;     *l=*r;     *r=temp; }  ①冒泡排序 雙層循環,兩兩比較  for(i=0;i<N-1

原创 我的友情鏈接

51CTO博客開發

原创 中斷

不能在中斷服務程序中執行類似操作的原因是運算時間太長,不能在中段中作複雜的工作,你可以在中斷服務程序中置一個標誌位.然後在主程序中查詢此位,判斷是否執行計算子程序.當然這樣做會在中斷產生與實際的中斷響應之間產生一定的延遲,如果你的系統對時間

原创 strlen/sizeof問題

#include <stdio.h>#include <string.h>int main(void){char *q="a",c='a',ch[10]="a";printf("%d\n",strlen(q));     //1printf

原创 棧和隊列

1.------------------------用數組實現棧#include <stdio.h>char stack[512];int top=0;void push(char c){    stack[top]=c;    top++

原创 minitor---監控

#include <unistd.h>#include <linux/inotify.h>#include <errno.h>#include <stdio.h>#include <string.h>#include <stdlib.h>#

原创 Makefile

1.Makefile是用來管理工程文件的工具  Makefile可以提高工作效率  Makefile減少出錯概率  make是解釋Makefile中指令的命令工具2.編譯過程: -E :預處理    -S: 編譯    -c: 彙編    

原创 ELF文件格式

1.紅色方框ELF Header2.藍色方框Section Header Table3.綠色方框內容4.紅色圓框內容開始位置

原创 單鏈錶、雙向鏈錶節點的掛接與摘除

------------------------單鏈錶#include <stdio.h>#include <stdlib.h>typedef struct node *link;struct node{    unsigned int i

原创 fork/execvp

-----------------------------gre.c(生成十個文件)#include <unistd.h>#include <stdlib.h>#include <stdio.h>#include <fcntl.h>#inc

原创 文件複製與查找

------------------------------文件複製#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>#include <dirent.h>#incl

原创 myshell_simple

#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <fcntl.h>#define N 4096void expcmd(c

原创 三層交換機和路由器的區別

近年來隨着Internet/Intranet的迅猛發展和B/S計算模式的廣泛應用,跨地域、跨網絡的業務急劇增長,業界和用戶深感傳統的路由器在網絡中的瓶頸效應。 而三層交換機既可操作在網絡協議的第三層,起到路由決定的作用,又具有幾乎達到第

原创 myprintf

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>void printi(int n){    char *p,*q;    p=malloc(100);    q=p;