int main(int argc,char *argv[]) { char ch while(true) { printf("*************************************\n") printf(" 1.Reader Priority\n") printf(" 2.Writer Priority\n") printf(" 3.Exit to Windows\n") printf("*************************************\n") printf("Enter your choice(1,2,3): ") do{ ch=(char)_getch() }while(ch!= 1 &&ch!= 2 &&ch!= 3 ) system("cls") if(ch== 3 ) return 0 else if(ch== 1 ) ReaderPriority("thread.dat") else WriterPriority("thread.dat") printf("\nPress Any Key to Coutinue:") _getch() system("cls") } return 0
資源簡介:int main(int argc,char *argv[]) { char ch while(true) { printf("*************************************\n") printf(" 1.Reader Priority\n") printf(" 2.Writer Priority\n") printf(" 3.Exit to Windows\n") printf("******...
上傳時間: 2017-01-06
上傳用戶:gonuiln
資源簡介:DESProcess FILE *mfp,*cfp int ttch=0,xorRes,ttbitdiff=0 char mch,cch float bdiff=0 if((mfp=fopen(mfile,"r"))==NULL) {cout<<"Cannot open the file to compare"<<endl } if((cfp=fopen(cfile,"r"))==NULL) {cout<<"Cannot open t...
上傳時間: 2016-07-02
上傳用戶:1079836864
資源簡介:int show_char(int n, const char *name, chtype code) { const int height = 16 int row = 4 + (n height) int col = (n / height) * COLS / 2 mvprintw(row, col, " *s : ", COLS/4, name) addch(code) return n + 1 }
上傳時間: 2017-06-12
上傳用戶:3到15
資源簡介:Linux 2.4.18 s3c2440 led driver 使用dev-C++撰寫,需要linux 2.4.18 kernel include,編譯完成後產生led module。 insmod main.o //安裝模組 mknod /dev/leds c 221 0 使用方法: int main(int argc, char *argv[]) { int testdev //led ...
上傳時間: 2014-01-01
上傳用戶:qlpqlq
資源簡介:用SHA算法實現對任意文件的hash摘要,并且把hash摘要值(至少為160bit)存入另一個文件,形如: hash inputfile hashvaluefile 說明:SHA算法的實現至少為160bit,或者可以選擇256,384或者512的,可以查閱相關資料,按照標準來實現(hash的算法是...
上傳時間: 2017-07-11
上傳用戶:cursor
資源簡介:RC4對文件加解密 實現RC4對任意文件的加解密,利用控制臺對所有文件(中英文文本、符號甚至任意的文件)的加解密。 加解密形式如下: ?? RC4 -e/-d key inputfile outputfile ? 說明:對于加密來說,輸入文件名就是明文文件,對于解密來說,輸...
上傳時間: 2016-12-16
上傳用戶:hmc123456
資源簡介:#include<iostream> using namespace std int main() { unsigned long x,warcraft,war,l cin> x while(x) { unsigned long *p=new unsigned long[x+1] if(p==NULL) { cerr<<"error!"<<endl abort() } for(warcraft...
上傳時間: 2015-12-12
上傳用戶:manlian
資源簡介:溫度華氏轉變攝氏 #include <stdio.h> #include <stdlib.h> enum x {A,B,C,D,E} int main(void) { int a=73,b=85,c=66 { if (a>=90) printf("a=A等級!!\n") else if (a>=80) printf("73分=B等級!!\n") else if (a>=70) printf(...
上傳時間: 2014-11-10
上傳用戶:wpwpwlxwlx
資源簡介:溫度華氏轉變攝氏 #include <stdio.h> #include <stdlib.h> enum x {A,B,C,D,E} int main(void) { int a=73,b=85,c=66 { if (a>=90) printf("a=A等級!!\n") else if (a>=80) printf("73分=B等級!!\n") else if (a>=70) printf(...
上傳時間: 2013-12-12
上傳用戶:亞亞娟娟123
資源簡介:成績顯示三個部份abc #include<stdio.h> #include<stdlib.h> int main(void) { float gread printf("請輸入分數\n") scanf("%f",&gread) if(gread>=80&&gread<=100) printf("成績為A\n") else if(gread>=60&&gread<=79) { printf("...
上傳時間: 2014-01-15
上傳用戶:waizhang
資源簡介:指定一個數字轉換回十進位,八進位,十六進位#include <stdio.h> #include <stdlib.h> int main(void) { int number =89 printf("數字 %d\n",number) /* %d 為十進位輸出格式*/ printf("八進位為 %o\n",number) /* %o 為八進位輸出格式*/ ...
上傳時間: 2013-11-29
上傳用戶:tyler
資源簡介:client socket include <sys/types.h> include <sys/socket.h> include <stdio.h> include <netinet/in.h> include <arpa/inet.h> include <unistd.h> int main() { int sockfd int len struct sockaddr_in address int result cha...
上傳時間: 2017-07-29
上傳用戶:wab1981
資源簡介:學會對文件的記錄鎖定,及解鎖。#include <stdio.h> #include <unistd.h> #include <fcntl.h> int main() { int fd int i struct { char name[20] uint ID int age } myrec fd =open("name", O_RDWR|O_CREAT, 0755) if (f...
上傳時間: 2016-01-04
上傳用戶:亞亞娟娟123
資源簡介:河內塔問題 #include<stdio.h> #include<stdlib.h> int fun_a(int) void fun_b(int,int,int,int) int main(void) { int n int option printf("題目二:河內塔問題\n") printf("請輸入要搬移的圓盤數目\n") scanf("%d",&n) printf("...
上傳時間: 2016-12-08
上傳用戶:努力努力再努力
資源簡介:int trace (int i, int j, int low, IMAGE im,IMAGE mag, IMAGE ori) float gauss(float x, float sigma) float dGauss (float x, float sigma) float meanGauss (float x, float sigma) void hysteresis (int high, int low, IMAGE im, IMAGE mag, IMAGE ori...
上傳時間: 2015-01-30
上傳用戶:杜瑩12345
資源簡介:曾經碰到過讓你迷惑不解、類似于int * (* (*fp1) (int) ) [10] 這樣的變量聲明嗎?本文將由易到難,一步一步教會你如何理解這種復雜的
上傳時間: 2014-01-08
上傳用戶:225588
資源簡介:矩陣運算的算法 用Type類數組創建矩陣對象 matrix(int rows,int cols) //創建矩陣,值為0 matrix(int n) //創建單位陣 matrix(const matrix &) //拷貝構造函數 BOOL Ismatrixf(){ return (rows==cols) } //判斷矩陣是否為方陣 modifyrowscols(...
上傳時間: 2015-07-14
上傳用戶:水口鴻勝電器
資源簡介:如何理解c和c ++的復雜類型聲明。 曾經碰到過讓你迷惑不解、類似于int * (* (*fp1) (int) ) [10] 這樣的變量 聲明嗎?本文將由易到難,一步一步教會你如何理解這種復雜的C/C++聲明。
上傳時間: 2014-01-03
上傳用戶:410805624
資源簡介:C語言庫函數速查[CHM文檔]是一個很好的C語言函數查詢器.屬于CHM文檔. iscntrl 原型:extern int iscntrl(int c) 用法:#include <ctype.h> 功能:判斷字符c是否為控制字符 說明:當c在0x00-0x1F之間或等于0x7F(DEL)時,返回非零值,否...
上傳時間: 2015-08-15
上傳用戶:lht618
資源簡介:PWM控制電機,用PWM控制電機,熟悉定時器Timer A/B的編程方法。用Timer A作為脈寬調制信號產生的定時器.了一個函數F_Pwm(int a,int b) 用于PWM設置,傳入兩個參數第一個用于頻率設置,第二個用于占空比設置。
上傳時間: 2015-10-10
上傳用戶:athjac
資源簡介:void statistics(int signo) unsigned short cal_chksum(unsigned short *addr,int len) int pack(int pack_no) void send_packet(void)
上傳時間: 2014-09-09
上傳用戶:liansi
資源簡介:本題的算法中涉及的三個函數: double bbp(int n,int k,int l) 其中n為十六進制位第n位,k取值范圍為0到n+7,用來計算16nS1,16nS2,16nS3,16nS4小數部分的每一項。返回每一項的小數部分。 void pi(int m,int n,int p[]) 計算從n位開始的連續m位的十六進制...
上傳時間: 2014-01-05
上傳用戶:xcy122677
資源簡介:huffman 編碼。typedef struct { int weight int flag int parent int lchild int rchild }hnodetype
上傳時間: 2016-02-06
上傳用戶:yan2267246
資源簡介:class Time { public: Time(int =0,int =0,int =0) void setTime(int,int,int) void printMilitary() void printStandard() private: int hour int minute int second }
上傳時間: 2013-12-20
上傳用戶:hwl453472107
資源簡介:曾經碰到過讓你迷惑不解、類似于int * (* (*fp1) (int) ) [10] 這樣的變量 聲明嗎?本文將由易到難,一步一步教會你如何理解這種復雜的C/C++聲明。
上傳時間: 2014-01-04
上傳用戶:aappkkee
資源簡介:曾經碰到過讓你迷惑不解、類似于int * (* (*fp1) (int) ) [10] 這樣的變量聲明嗎?本文將由易到難,一步一步教會你如何理解這種復雜的C/C++聲明
上傳時間: 2013-12-16
上傳用戶:libenshu01
資源簡介:void III_hufman_decode(struct Granule *gr,int part2_start, int freqline[SBLIMIT][SSLIMIT]) { unsigned int reg1, reg2,i unsigned int part3_length = part2_start + gr->part2_3_length unsigned used int h,*f=&freqline[0][0] ...
上傳時間: 2013-12-19
上傳用戶:jjj0202
資源簡介:請編寫一個函數jsValue(int m,int k,int xx[]),該函數的功能是:將大于整數m且緊靠m的k個素數存入數組xx傳回。 最后調用函數writeDat()讀取10組數據,分別得出結果且把結果輸出到文件out.dat中。 部分源程序存在文件prog1.c中。 例如:若輸入17 5 則應...
上傳時間: 2016-06-05
上傳用戶:change0329
資源簡介:孫鑫老師VC視頻第十二課代碼:const char *與char * const的區別。C語言對文件讀寫的支持,FILE指針;文本文件和二進制文件的區別。用文本方式讀寫文件和以二進制方式讀寫文件的注意事項。C++對文件讀寫的支持,ofstream和ifstream的用法。Win32 SDK對文件讀...
上傳時間: 2016-06-15
上傳用戶:dapangxie
資源簡介:本文關鍵詞: c++ 字符串 函數 char *strcpy(char *s1, const char *s2) 將字符串s2復制到字符串數組s1中,返回s1的值 char *strncpy(char *s1, const char *s2, size_t n) 將字符串s2中最多n個字符復制到字符串數組s1中,返回s1的值
上傳時間: 2016-07-09
上傳用戶:lz4v4