freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

編程的調試技巧(留存版)

2025-09-21 11:18上一頁面

下一頁面
  

【正文】 =i。z=10。 } coutendl。 } 輸出星號 ? 使用到的調試方法: ? 分段調試 ? 單步 F10調試 ? run to cursor ? 強制輸出( flush) ? 用 watch窗口觀察表達式的值 include void main() { for(int i=1。n) cout39。 for(int t=1。 39。s=10。i++) { for(int j=1。 coutendl。t++) { for(int k=1。 for(int i=1。i=m1。 if (type = 65 amp。amp。 case 39。 coutinteger1 is:。39。y39。 } 根據輸入給出輸出 結 論 2 ? 要盡可能的熟悉語法知識 ? 充分利用編譯器提供的信息 ? 編程過程中要細心 ? 思路要清晰,沒把握時,要先畫流程圖,然后再編碼 include int main() { double a, b, c, d。 } coutthe oute isouteendl。*39。\039。 /* display decimal number in LCD */ /*FUNC COMMENT************************************************************* * ID : * function name : main * function : call function to get string length, display result * parameter : none * return : result 0:normal end * function used : get_strlength * notice : none * History : *FUNC COMMENT END********************************************************/ int main(void) { unsigned char buff[10+1]。 Release:沒有調試信息,不能調試,文件小 切換 Debug模式和Release模式 比較文件大小 編譯( ctrl+F7):編譯源文件到目標文件 構建( F7):鏈接目標文件和庫函數為可執(zhí)行文件,如無目標文件則先生成 清潔:刪掉 debug或者 release版本的所有中間文件和可執(zhí)行文件 調試 單步執(zhí)行( F10):單步執(zhí)行,遇到函數調用時把其當作一條語句執(zhí)行 深入函數的單步執(zhí)行( F11):單步執(zhí)行,遇到函數調用是深入到其內部 執(zhí)行到光標處( ctrl+F10):一次執(zhí)行完光標前的所有語句,并停到光標處 跳出( shift+F11):執(zhí)行完當前函數的所有剩余代碼,并從函數跳出 重新開始調試( ctrl+shift+F5):重新開始調試過程 結束調試( shift+F5):執(zhí)行完程序的剩余部分,結束調試 設置 /取消斷點( F9):在某一行設置和取消斷點 當前執(zhí)行的語句 堆棧的內容:函數調用關系 從這里可以 查看內存數據 程序執(zhí)行過程中的一 些變量會顯示在這里 著名的 watch窗口:看變量 表達式、地址等各種信息 寄存器當前值 二、調試方法 樹立正確的編程方法論 ? 沒有解決不了的問題,樹立編程信心 ? 按照正確的方法來編程 –從實踐中體會解決問題的思路、編程的思想 –熟練掌握語法,數據結構,算法、模式,底層環(huán)境 –按照編程規(guī)范來編寫代碼 –充分利用各種資源: ?調試器 ? msdn ?網絡搜索引擎 常用調試手段 1. 利用編譯器的輸出信息排除錯誤 2. 利用調試器的調試功能 單步、 run to cursor、斷點、條件斷點、查看堆棧、 利用 watch窗口查看變量、表達式的值 3. 分段調試法、增量調試法 4. 利用 flush人為刷新緩沖區(qū) 5. 修改輸出信息,增加標志位 6. 利用輸出語句打印調試信息 7. 通過堆棧觀察函數調用情況 8. 綜合程序調試方法 9. 注釋的技巧、條件編譯 幾個簡單例子 include include void main() { coutsetw(10)十進制 setw(10)二進制 setw(10)八進制“ setw(10)十六進制 endl。 static void get_string(unsigned char *message, unsigned char *buff)。 /* define and initialize variable for string length*/ /* refer every character in onedimensional array buff pointed by */ /* pointer str, count up until detect (39。 coutenter its operater:endl。:oute=num1num2。 else 。 include void main() { double integer1,integer2,e,f,g,h。:coute。 char op,a。39。) { cout請輸入一個字符: endl。!39。 cout請輸入一個正整數 :endl。 cout請輸入一個正整數 :endl。 } coutendl。n=11s。 } coutendl。 coutendl。z++) { for(int p=9。flush。 39。*39。k++) cout39。 coutendl。 } 調試后的程序,改正了循環(huán)中的邏輯問題,另外,本程序存在變量定義過多的缺點 include void main() { for(int i=1。 } coutendl。p=10z。 else return n * Factorial ( n 1 ) 。 int m = n * Factorial ( n 1 )。 } if(prime) { coutsetw(5)m。 } if(n%10==0) coutendl。 } coutendlthe total number is: nendl。 39。++i) { for(int m=1。 coutsetw(i)setfill(39。*39。 coutendl。 ? 解決辦法:在命令提示符下執(zhí)行程序,使用輸出重定向功能,然后去相關目錄下查看輸出文件。++n) cout*flush。 } return 0。)39。i=k。 for(i=2。m=199。 void main () { int k 。 //例 求階乘 include int Factorial ( int ) 。*39。t=10。q=z。flush。 coutendl。p=10z。 } coutendl。 } 輸出星號 分析:程序比較長,輸出怪異,一時難以發(fā)現(xiàn)出錯地點,所以采用化整為零、化繁為簡的分段調試法 include void main() { for(int i=1。n) cout39。 for(int t=1。 39。s=10。i++) { for(int j=1。
點擊復制文檔內容
醫(yī)療健康相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1