標籤:c語言之前寫過一篇C的語言的角落,介紹了一些C中的一些非常用特性(http://blog.csdn.net/yang_yulei/article/details/34557625),最近又整理了一些邊角的知識,特開此文。switch語句中的case(case 關鍵詞可以放在if-else或者是迴圈當中)switch (a){ case 1:; // ... if (b==2) { case 2:; // ... }
標籤:多態 c++ 應用 mfc 做java,Android開發。因為項目需要,學了點C++,我講講這兩天對虛函數的認識吧。如果說錯了,歡迎指正。也是希望拋磚引玉。一、定義虛函數是為了統一介面1、虛函數類似於Java的介面。當繼承了這個父類,就要實現聲明裡面的虛函數,開始實現函數方法。繼承父類就叫衍生類別。2、父類裡面有些不是虛函數
標籤:c++11auto自動推導類型。 auto i = 10; std::cout << i << std::endl; double x = 12.34; auto *y = new auto(x); std::cout << *y << std::endl;decltype可以擷取變數或值的類型名稱,替換源碼中的調用。int x = 0;decltype(x) y = x;nullptrnull 指標,指向地址0
標籤:c++ iostream Description從鍵盤輸入任意整數n,若n不是素數,則計算出n的所有因子(不包括1),例如對於16,輸出2,4,8;否則輸出“It is a prime number.”判斷素數和求因子分別用函數完成。Input任意整數nOutput該數的因子或素數標誌。Sample Input16Sample Output248/* Copyright (c) 2014, 煙台大學電腦學院 * All
標籤:Part 72 What is dictionary in c# Part 73 What is dictionary in c# continuedPart 74 List collection class in c#Part 75 List collection class in c# continuedPart 76 Working with generic list class and ranges