目錄 C語言基礎知識 C 語言簡介 C 語言的特點… C 語言的發展和標準化…數據類型、運算、表達式和編譯預處理 數據類型… 基本類型與數據表示 整數類型和整數的表示… 實數類型和實數的表示… 字符類型和字符的表示… 運算符、表達式與計算… 算術運算符 算術表達式 表達式的求值… 變量——概念、定義和使用… 變量的定義0 變量的使用:取值與賦值 預處理 文件包含命令… 宏定義與宏替換…邏輯判斷與運算… 關系運算和邏輯運算 復雜條件的描述0 i f語句循環控制 whi le語句 for語句… 循環程序常用的若干機制 增量和減量運算符(++、--) 逗號運算符 控制結構和控制語句 do-while循環結構… 流程控制語句… goto語句… 開關語句…函數 概述… 函數定義和程序的函數分解… 函數定義… 函數調用…數組 數組的概念、定義和使用 數組變量定義… 數組的使用 數組的初始化…結構 結構(struct) 結構說明與變量定義 結構變量的初始化和使用 結構與函數 處理結構的函數0指針 指針的概念 指針操作… 指針作為函數的參數 與指針有關的一些問題… 指針與數組 指向數組元素的指針 基于指針運算的數組程序設計 數組參數與指針 字符指針與字符數組0
上傳時間: 2013-11-16
上傳用戶:asdkin
//------------------------------------------------------------------------------------//此程序為ADC轉換程序,可以選擇向ADC0BUSY寫1或用定時器0,1,2,3作為ADC的啟動信號。////------------------------------------------------------------------------------------//頭文件定義//------------------------------------------------------------------------------------//#include <c8051f330.h> #include <stdio.h> //-----------------------------------------------------------------------------// 定義16位特殊功能寄存器//----------------------------------------------------------------------------- sfr16 ADC0 = 0xbd; sfr16 TMR0RL = 0xca; sfr16 TMR1RL = 0xca; sfr16 TMR2RL =0xca; sfr16 TMR3RL =0xca; sfr16 TMR0 = 0xCC; sfr16 TMR1 = 0xCC; sfr16 TMR2 = 0xcc; sfr16 TMR3 = 0xcc; //-----------------------------------------------------------------------------// 全局變量定義//-----------------------------------------------------------------------------char i;int result; //-----------------------------------------------------------------------------//定義常量//-----------------------------------------------------------------------------#define SYSCLK 49000000 #define SAMPLE_RATE 50000 //------------------------------------------------------------------------------------// 定義函數//------------------------------------------------------------------------------------void SYSCLK_Init (void);void PORT_Init (void);void Timer0_Init (int counts);void Timer1_Init (int counts);void Timer2_Init (int counts);void Timer3_Init (int counts);void ADC0_Init(void);void ADC0_ISR (void);void ADC0_CNVS_ADC0h(void);//------------------------------------------------------------------------------------// 主程序//------------------------------------------------------------------------------------ void main (void) { int ADCRESULT[50] ; int k; PCA0MD &= ~0x40; // 禁止看門狗 SYSCLK_Init (); PORT_Init (); Timer0_Init (SYSCLK/SAMPLE_RATE); //Timer1_Init (SYSCLK/SAMPLE_RATE); //選擇相應的啟動方式 //Timer2_Init (SYSCLK/SAMPLE_RATE); //Timer3_Init (SYSCLK/SAMPLE_RATE); ADC0_Init(); EA=1; while(1) { //ADC0_CNVS_ADC0h(); k=ADC0; ADCRESULT[i]=result; //此處設斷點,觀察ADCRESULT的結果 } }
上傳時間: 2013-10-13
上傳用戶:SimonQQ
C++在幾乎所有的計算環境中都非常普及,而且可以用于幾乎所有的應用程序。C++從C中繼承了過程化編程的高效性,并集成了面向對象編程的功能。C++在其標準庫中提供了大量的功能。有許多商業C++庫支持數量眾多的操作系統環境和專業應用程序。但因為它的內容太多了,所以掌握C++并不十分容易。本書詳述了C++語言的各個方面,包括數據類型、程序控制、函數、指針、調試、類、重載、繼承、多態性、模板、異常和輸入輸出等內容。每一章都以前述內容為基礎,每個關鍵點都用具體的示例進行詳細的講解。本書基本不需要讀者具備任何C++知識,書中包含了理解C++的所有必要知識,讀者可以從頭開始編寫自己的C++程序。本書也適合于具備另一種語言編程經驗但希望全面掌握C++語言的讀者。 I created all the files under Microsoft Windows so lines are terminated by CR/LF. In addition to this "ReadMe" file you will find three zip archives in the primary archive, so you need to unzip each of these to get at the code. 為PDG格式,這有pdg閱讀器下載|pdg文件閱讀器下載
標簽: 源代碼
上傳時間: 2013-11-18
上傳用戶:gaoqinwu
Grammatica is a C# and Java parser generator (compiler compiler). It improves upon simlar tools (like yacc and ANTLR) by creating well-commented and readable source code, by having automatic error recovery and detailed error messages, and by support for testing and debugging grammars without generating source code. It supports LL(k) grammars with an unlimited number of look-ahead tokens.
標簽: compiler Grammatica generator improves
上傳時間: 2015-01-11
上傳用戶:stella2015
Setting up an ADOCE project using Visual C++ 6.0 is rather simple. Assuming that you have downloaded and installed the ADOCE SDK from Microsoft, you are ready to use it in your Windows CE Database applications. The sample that I have provided is a *very* simple one illustrating how to instantiate the proper COM objects, and the basics of how to interface with them (in a very simple example)
標簽: downloaded Assuming Setting project
上傳時間: 2015-01-16
上傳用戶:陽光少年2016
旅行家問題 一個旅行家想駕駛汽車以最少的費yi 用從一個城市到另一個城市(假設出發時油箱是空的)。給定兩個城市之間的距離為D1、汽車油箱的容量為C(以升為單位),每升汽油能行駛的距離為 D2,出發點每升汽油價格P和沿途油站數N(N可以為零),油站i離出發點距離Di,每升汽油價格Pi(i=1,2...N)。計算結果四舍五入至小數點后兩位。 如果無法到達目的地,則輸出“No Solution"。
上傳時間: 2015-02-14
上傳用戶:vodssv
Rainbow is a C program that performs document classification usingone of several different methods, including naive Bayes, TFIDF/Rocchio,K-nearest neighbor, Maximum Entropy, Support Vector Machines, Fuhr sProbabilitistic Indexing, and a simple-minded form a shrinkage withnaive Bayes.
標簽: classification different document performs
上傳時間: 2015-03-03
上傳用戶:希醬大魔王
用c語言設計實現一個用事件驅動的“救護車調度”離散模型,模擬120急救中心響應每個病人的呼救信號統一調度救護車運行的情況。 我們對問題作適當簡化,假設:某城市共有m個可能的呼救點(居民小區、工廠、學校、公司、機關、單位等),分布著n所醫院(包含在m個點中),有k輛救護車分派在各醫院待命,出現呼救病人時,由急救中心統一指派救護車接送至最近的醫院救治。救護車完成一次接送任務后即消毒,并回原處繼續待命。假定呼救者與急救中心、急救中心與救護車之間的通訊暢通無阻,也不考慮道路交通堵塞的影響。可以用m個頂點的無向網來表示該城市的各地點和道路。時間可以分鐘為單位,路段長可表示為救護車行駛化費的分鐘數。 這里設m=10,n=3,k=2。并且令消毒時間為2分鐘
上傳時間: 2014-01-11
上傳用戶:invtnewer
This directory contains code implementing the K-means algorithm. Source codemay be found in KMEANS.CPP. Sample data isfound in KM2.DAT. The KMEANSprogram accepts input consisting of vectors and calculates the givennumber of cluster centers using the K-means algorithm. Output isdirected to the screen.
標簽: implementing directory algorithm contains
上傳時間: 2014-01-27
上傳用戶:maizezhen
They have been developed using the AZTEC C86 compiler, and are portable to any other standard C environment. I have tested this code with AZTEC CII for the 8080, and with the C compiler on XENIX 286, and they work fine.
標簽: developed compiler portable standard
上傳時間: 2014-01-05
上傳用戶:lizhen9880