Time of Update: 2018-12-04
stack.h#ifndefSTACK_H#defineSTACK_H1#include <stdio.h>#include <string.h>#include <malloc.h>#defineSTACK_MAX256struct snode{charname[32];intnum;structsnode*next;};struct stack{intstacksize;structsnode*top;};struct stack
Time of Update: 2018-12-04
open和fopen的區別:1.緩衝檔案系統緩衝檔案系統的特點是:在記憶體開闢一個“緩衝區”,為程式中的每一個檔案使用,當執行讀檔案的操作時,從磁碟檔案將資料先讀入記憶體“緩衝區”, 裝滿後再從記憶體“緩衝區”依此讀入接收的變數。執行寫檔案的操作時,先將資料寫入記憶體“緩衝區”,待記憶體“緩衝區”裝滿後再寫入檔案。由此可以看出,記憶體 “緩衝區”的大小,影響著實際操作外存的次數,記憶體“緩衝區”越大,則操作外存的次數就少,執行速度就快、效率高。一般來說,檔案“緩衝區”的大小隨機器
Time of Update: 2018-12-04
queue.h#ifndefQUEUE_H#defineQUEUE_H1#include <stdio.h>#include <string.h>#include <malloc.h>#defineQUEUE_NODE_MAX1024struct qnode{charname[32];intnum;structqnode*next;};struct
Time of Update: 2018-12-04
題目:就是實現位的替換原型:void append(unsigned char *s,int n,unsigned char *buf,int len)說明:s為目標字串,n為位元,buf為緩衝區,len為buf的長度。現在要在s中的第n位開始,賦上buf的值。不能用動態記憶體分配函數。求解答。注意,我說的是位。。。。不是位元組。。相當於是s中的第n位到第n+len位是buf的len位。題目來自:http://topic.csdn.net/u/20111108/12/8eb961d4-7d35-
Time of Update: 2018-12-04
學校的極域電子教室程式及其煩人,上課的時候老師總是控制我們電腦,我一直想破解,所以發布了《[原]VC被控制時關閉極域電子教室、破解聯想硬碟保護系統密碼(上)》和《[原]VC被控制時關閉極域電子教室、破解聯想硬碟保護系統密碼下》兩篇日誌。前幾天,我成功的利用了老師的極域電子教室實現了控制別人電腦。 所需材料:虛擬機器軟體:建議使用VirtualBox,開源的,還不錯。用虛擬機器主要是虛擬機器軟體一關,老師就查不到了。防止執行後面步驟時被發現。[ :360雲端硬碟,檔案大小:90.1
Time of Update: 2018-12-04
字元功能 01H、07H和08H —從標準輸入裝置輸入字元 02H —字元輸出 03H —輔助裝置的輸入 04H —輔助裝置的輸出 05H —列印輸出 06H —控制台輸入/輸出 09H —顯示字串 0AH — 鍵盤緩衝輸入 0BH —檢測輸入狀態 0CH —清輸入緩衝區的輸入功能1、功能01H、07H和08H
Time of Update: 2018-12-04
以前見過這題幾次,也不記得是哪裡的面試題了。1024可計為N解題方法有兩種:一、使用大整數運算,也算是“暴力求解”了。但只看可能的求解長度就下一跳啊。此法不可取。二、運用數學理論不難發現:1、結果0的個數是和其小於N中各位為5的個數不無關係的。不是5的倍數無論和哪個相乘都不可能出現個位為0的結果。N以內的偶數個數肯定是大於5倍數的個數的(5和偶數相乘才可能增加末位0的個數)。所以有a = N / 5;2、再看一下25這個是不是有點特殊呢?25 * 4 =
Time of Update: 2018-12-04
Time of Update: 2018-12-04
幾個月前我突然對資源釋放起了濃厚的興趣,於是在網上搜啊搜,內容幾乎被一篇文章這裡面的內容所壟斷了,由於文章上只給了部分源碼,而其他的則需要10分CSDN分去下載,於是我就擱置了幾個月。
Time of Update: 2018-12-04
最近想弄一個可以實現多線程並發串連的程式,用VC實現,可是網上沒有現成的多線程並發源碼,我只好自己做一個。我開始一直不知道怎麼弄,後來在看一個文章的時候,有一句話提醒了我:“Accept函數會返回一個新的SOCKET串連。”(大意是這樣哈)。 說到這你可能已經會了。靈感就在一瞬間啊!我以前怎麼沒有注意到呢?#include <stdio.h>#include <Winsock2.h>#pragma comment(lib,
Time of Update: 2018-12-04
昨天下午又實驗了一下,發現上不了網,《成功使用MU3-WN823N無線USB網卡》(http://sunnysab.blog.163.com/blog/static/180375009201272901752817/)一文中的B電腦可以上網可能有些問題,因為我沒有設定DNS地址等等(好像網卡驅動會自動化佈建)。 後來我想到了一種方法——Proxy 伺服器,使用Proxy 伺服器就可以了(我不是打廣告的,我用的是Ccproxy示範版,示範版只支援3個使用者串連,對我來說足夠了)。
Time of Update: 2018-12-04
#include <stdio.h>#include <stdlib.h>#include <malloc.h>#include <string.h>#include <arpa/inet.h>#define ROW_UNIT 512#define UNIT_LENGTH 500/* 其中ROW_UNIT為使用的位長度,是64的整數倍,但乘積大於UIIT_LENGTH UNIT_LENGTH為需要轉換的位長度。 UNIT_
Time of Update: 2018-12-04
《[原]關於VC運行時關閉極域電子教室的改進方法》
Time of Update: 2018-12-04
#include <stdio.h>#include <string.h>#include <malloc.h>#include <stdlib.h>int binary_serch(int *arr, int arr_len, int value){int l = 0;int h = arr_len - 1;int m;while(l <= h) {m = l + ((h-l)>>1);if(value > arr[m])
Time of Update: 2018-12-04
用以刪除一個目錄下類似“# *****”格式的設定檔注釋,只可刪除單獨的行。#include <stdio.h>#include <string.h>#include <dirent.h>#include <time.h>int traversal_dir(const char *dir, int dept);int del_file_com(const char *file_path);int main(int argc, char *argv[
Time of Update: 2018-12-04
hash.h#ifndef HASH_H#define HASH_H1#include <stdio.h>#include <time.h>#include <string.h>#include <malloc.h>#include <list.h>#define NMN_USER_HASH_LIST_MAX1024struct user {struct hlist_node sibling;charusername[32];/*
Time of Update: 2018-12-04
問題描述:一個色子有六(N)面,每面出現是等機率的。現使用該色子隨機表示M個等機率事件。#include <stdio.h>#include <stdarg.h>#include <stdlib.h>#include <dirent.h>#include <sys/stat.h>#include <string.h>#include <time.h>#define EVENT_MAX100static int
Time of Update: 2018-12-04
#include <afx.h>#include <stdio.h>unsigned char * base64=(unsigned char *)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";// 編碼CString Base64Encode(CString src, int srclen){ int n, buflen, i, j; CString buf =
Time of Update: 2018-12-04
原題出自:http://topic.csdn.net/u/20120313/10/8feef8d4-6cd6-41a4-8955-a1bf7f9734b8.html問題:有81個選手,9個賽道,要求選出前4名。需要多少場?第一輪將81個選手編成9個組,分別為A、B、C、D、E、F、G、H、I9個組分別在賽場比賽一次,可得名次排序。需要9場。A B C D E F G H I1 1 1 1 1 1 1 1 12 2 2 2 2 2 2 2 23 3 3 3 3 3 3 3 34 4 4 4 4 4
Time of Update: 2018-12-04
linklist.h#ifndefLINK_LIST_H#defineLINK_LIST_H1#include <stdio.h>#include <string.h>#include <malloc.h>struct stu{charname[32];charstu_num[32];charsex[16];intage;structstu*next;structstu*pre;};struct stu *initlist(struct stu **head)