Time of Update: 2016-05-08
標籤: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace ClassTrining 7 { 8 public class MyTestClass 9 {10 /// <summary>11 /// 12 /// </summary>13
Time of Update: 2016-05-08
標籤: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 /// <summary> 7 /// 命名空間 8 /// </summary> 9 namespace ClassTrining10 {11 /// <summary>12 /// 命名空間中的命名空間,也叫子命名空間13 ///
Time of Update: 2016-05-08
標籤: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace ClassTrining 7 { 8 class 基類與衍生類別 9 {10 }11 12 /// <summary>13 /// 基類BaseClass14 /// </summary>15
Time of Update: 2016-05-08
標籤: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Runtime.InteropServices; 5 using System.Text; 6 7 namespace ClassTrining 8 { 9 class Demo 10 { 11 //===============屬性===============
Time of Update: 2016-05-08
標籤:前言不知道大家對const和readonly關鍵字兩者的區別瞭解多少,之前真不是很清楚,如果你也不是很清楚的話,那就一起來探討吧!探討之前我們先來瞭解靜態變數和動態變數。靜態變數 所謂靜態變數就是在編譯期間會對變數進行解析,再講常量的值替換成初始化的值。定義時必須初始化。動態變數 所謂動態變數就是編譯期間會將變數標示唯讀常量,而不用常量的值代替,定義時可以不初始化,可以延遲到建構函式。const和readonlyC#基礎知識七之const和readonly關鍵字
Time of Update: 2016-05-07
標籤://練習1:截取生日 Console.Write("請輸入你的社會安全號碼碼:"); string id = Console.ReadLine(); Console.WriteLine("你的生日是:" + id.Substring(6, 4) + "年" + id.Substring(10, 2) + "月" + id.Substring(12, 2) + "日");
Time of Update: 2016-05-08
標籤: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace ClassTrining 7 { 8 class 員工 9 {10 /// <summary>11 /// 姓名12 /// </summary>13 public
Time of Update: 2016-05-08
標籤: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace ClassTrining 7 { 8 class 事件 9 {10 class Demo11 {12 /// <summary>13 ///
Time of Update: 2016-05-07
標籤: 最近在學習C#,在C#中的類看到重寫和隱藏基類的方法這些概念。才開始感覺自己不是很理解這些概念。也區分不開這些概念。通過自己的尋找資料和練習後。慢慢的理解了類中的隱藏和重寫這個概念。在C#中只有在基類定義了一些虛方法才能在衍生類別中重寫基類中的虛方法。但是如果在衍生類別中使用隱藏方法,就不用在基類中定義虛方法。虛方法和重寫實現的功能感覺是差不多的。都是在衍生類別中改變了基類中的方法,但是兩者還是有質的區別,概念的性質也是不一樣的。
Time of Update: 2016-05-07
標籤:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace DelegateDemo1{ class Program { static void One() { Console.WriteLine("one");
Time of Update: 2016-05-07
標籤: string fname = Directory.GetCurrentDirectory() + "\\LogFile.log"; FileInfo finfo = new FileInfo(fname); if (!finfo.Exists) { FileStream fs; fs = File.Create(fname); fs.
Time of Update: 2016-05-08
標籤:import include 引號 單書名號 objectivec#include 指令只是告訴編譯器把所要引用的標頭檔複製粘貼過來#import 會檢查是否已經匯入過了,更有效率,更快。比如a檔案引用過標頭檔x.h,b檔案也需要x.h,但b檔案引用了a,則b中就不需要再重新引用x.h了。<>和“”在標頭檔的區別一般系統內建的用<>而使用者自己定義的用""objective c:import和include的區別, ""和<>區別
Time of Update: 2016-05-07
標籤:/* ***********************************************Author :MaltubEmail :[email protected]Blog :htttp://www.xiang578.com************************************************ */#include <cstdio>#include
Time of Update: 2016-05-07
標籤:重讀經典:《C和指標》學習筆記之第一章至第九章《C和指標》、 《C專家編程》、 《C陷阱和缺陷》並稱c語言三本經典著作,筆者在許多年前囫圇吞棗讀完了這三本經典,然後把這三本書束之高閣。時至今日,大部分內容都已忘記,前些時間偶然翻出來,重讀這些經典,順便做做筆記,記錄其精華。 《C和指標》通過對指標的基礎知識和進階特性的探討,協助程式員把指標的強大功能融入到自己的程式中去。第1章 快速上手本章講的是C語言的基礎知識,目的是使讀者對C語言有一個整體的初步的認識。
Time of Update: 2016-05-07
標籤:HI各位使用者:
Time of Update: 2016-05-07
標籤:main.m//// main.m// Foundation//// Created by zhaogang on 16/5/6.// Copyright ? 2016年 zhaogang. All rights reserved.//#import <Foundation/Foundation.h>int main(int argc, const char * argv[]) { NSError *error = nil; NSString *path =
Time of Update: 2016-05-07
標籤:main.m//// main.m// 04-block//// Created by apple on 13-8-11.// Copyright (c) 2013年 itcast. All rights reserved.//#import <Foundation/Foundation.h>/* block要掌握的東西 1> 如何定義block變數 int (^sumBlock)(int, int); void (^myBlock)(); 2>
Time of Update: 2016-05-06
標籤:分析:算1和2的起點在哪裡,然後往後累加就可以了。#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <queue>#include <cmath>using namespace std;int ans[1000005];int main(){ //freopen("1.in","r", stdin)
Time of Update: 2016-05-06
標籤:原始碼在編譯成機器指令之前,要進行預先處理。預先處理功能主要包括宏定義,檔案包含,條件編譯三部分。這些預先處理操作發生在編譯器過程中,它們會修改程式的語句,但不會幹涉程式的執行。ANSI標準定義的C語言預先處理程式包括下列命令:指令 用途 #include 包含一個原始碼檔案 #define 定義宏 #undef 取消已定義的宏 #if 如果給定條件為真,則編譯下面代碼 #ifdef 如果宏已經定義,則編譯下面代碼
Time of Update: 2016-05-06
標籤:簡介C 標準庫的 assert.h標頭檔提供了一個名為 assert 的宏,它可用於驗證程式做出的假設,並在假設為假時輸出診斷訊息。已定義的宏 assert 指向另一個宏 NDEBUG,宏 NDEBUG 不是 <assert.h> 的一部分。如果已在引用 <assert.h> 的源檔案中定義 NDEBUG 為宏名稱,則 assert 宏的定義如下:#define