Time of Update: 2018-12-03
學IT的,廢話少說,直接看代碼。#include<iostream>#include<vector>#include<list>using namespace std;int main(){ int a[]={1,2,3,4,5,6,7,8,9,10}; vector<int>v(a,a+10); list<int>l(a,a+10); for(vector<int>::iterator
Time of Update: 2018-12-03
在使用包含內容的時候,對於表示類X的對象,存在著兩種主要的可選方式:1生命一個類型為X的成員2生命一個類型為X*或者X&的成員如果指標值絕不改變,那麼除了效率問題和寫建構函式,解構函式的方式之外,這些選擇方案是完全等價的:class X{ public: X(int);};class C{ X a; X *p; X &r;public: C(int i,intj,int k):a(i),p(new X(j)),r(*new X(k)){} ~C(){delete
Time of Update: 2018-12-03
我以為有一個Date的類,不像Java,C++沒有這個類,可以使用C庫time.h的函數來擷取目前時間,或者調用DOS的date方法一:#include <iostream>#include <ctime>#include<string>using namespace std;int main (){ time_t rawtime; struct tm * timeinfo; time ( &rawtime ); timeinfo =
Time of Update: 2018-12-03
操作相對簡單,但不要以為簡單而不動手,檔案操作流在Java和C++都很重要,以下是雛形:(讓您濺笑了)檔案寫入操作#include<iostream>#include<string>#include<fstream>using namespace std;int main(){ ofstream file("c:\\hello.txt"); if(!file){ cout<<"can't open it"<<endl;
Time of Update: 2018-12-03
有了一定的Windows32編程知識,就能學習MFC了。在學習MFC之前,一定要弄明白Windows32編程中的訊息迴圈是怎麼回事。MFC實際上就是對Windows API函數的封裝。 在Windows程式設計編程中,建立一個視窗要經曆下面四個過程 (如有不懂,請看部落格
Time of Update: 2018-12-03
原來簡單解釋過屬性定義(Property) ,並且提起了簡單的retain,copy,assign的區別。那究竟是有什麼區別呢? assign就不用說了,因為基本上是為單一資料型別準備的,而不是NS對象們。 Retain vs. Copy!! copy:
Time of Update: 2018-12-03
---------------------- Windows Phone 7手機開發、.Net培訓、期待與您交流! ---------------------- 這幾天接觸到了“黑馬程式員”這一培訓班,覺得這是個機遇呀。按照流程通過的申請,下載視頻,把C#的基礎又複習了一邊,把其中比較重要的和自己容易忘記的知識點總結了下來。1.類的修飾符包括:new,public,protected,private,internal,abstract,sealed。
Time of Update: 2018-12-03
大家知道,C++中線程分兩種,一種是工作者線程,另外一種就是GUI線程,至於他們這間的區別大家可以上網上尋找這裡我只是說明一下,建立GUI線程時,需要注意的地方。有些和視窗相關的線程,最好是放在GUI線程裡,因為和視窗或是特殊控制項有關的初使化操作,GUI線程已經幫你合理的最佳化了,如果用工作者線程需要自己做這些操作,往往我們是做不好的。如果建立的MFC程式,在主視窗線程裡再建立一個子線程,用來產生一個視窗,那麼就用GUI線程,這時候,因為進程中有兩個GUI線程,新建立的視窗發送WM_CLOSE
Time of Update: 2018-12-03
下面就是excel批量上傳資料到資料庫一:UI層1.前台代碼:<a>上傳檔案(Excel):<asp:FileUpload ID="FileUpload1" runat="server" Width="237px" /></a> <a> <asp:Button ID="btnUp" runat="server" Text="匯入資料庫" Width="75px"
Time of Update: 2018-12-03
1.變數聲名C# :int x;String s;String s1, s2;Object obj;Object obj = new Object();public String name;VB文法Dim x As IntegerDim s As StringDim s1, s2 As StringDim obj 'Implicitly ObjectDim obj As New Object()Public name As String 2語句C#:Response.Write("123456"
Time of Update: 2018-12-03
對C#委託及事件委託的理解委託的聲明public delegate void MyDelegate(string
Time of Update: 2018-12-03
http://hi.baidu.com/xiaoyear/blog/item/2f52e91310ad8422dc5401ba.html(轉)第一部分:C#入門1,可以為類或者命名空間指定別名例如(命名空間別名):using myAlias = myNameSpace1.myNameSpace2.Space32, C#的另外幾種開發工具:SharpDevelop / Snippet Compiler C#返編譯軟體:.NET Reflector C#單元測試工具:NUnit
Time of Update: 2018-12-03
C# 中實現 foreach 功能 1. MySplit 類 ////// MySplit 類 /// public class MySplit : IEnumerable { private string[] elements; public MySplit(string source, char[] delimiters) { elements = source.Split(delimiters); } IEnumerator IEnumerable.GetEnumerator() {
Time of Update: 2018-12-03
C# 2.0引入了很多語言擴充,最重要的就是泛型(Generics)、匿名方法(Anonymous Methods)、迭代器(Iterators)和不完全類型(Partial Types)。• 泛型允許類、結構、介面、委託和方法通過它們所存貯和操作的資料的類型來參數化。泛型是很有用的,因為它提供了更為強大的編譯期間類型檢查,需要更少的資料類型之間的顯式轉換,並且減少了對裝箱操作的需要和運行時的類型檢查。•
Time of Update: 2018-12-03
文/Peter Jiang(譯自newlc.com) Borland C++BuilderX是一個優秀的Symbian開發環境.可是它在預設情況下無法調試基礎控制台程式,我有一個辦法可以讓它成為可能,但需要對你的項目配置做一些變動.Alt+F7或是使用Project/Project.菜單來開啟下面的視窗. 選擇Make&Run或Run選項並編輯它.進入Project配置視窗: 把模擬器路徑中的EPOC.exe字串改成你應用程式的名字.見圖上的紅色圓圈.OK,現在可以了!
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Text;namespace 委託{ class 委託排序 { private delegate bool EqualsMyContent(Object lobj, Object robj); static void Main(string[] args) { Person[] pers = new Pe
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace CSharp基礎{ public delegate void ActionEventHandler(object sender, ActionCancelEventArgs args); class 事件模型 { public static void Main() {
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;namespace 多線程{ class 等待控制代碼 { public delegate int TakesAwhileDel(int data, int ms); static void Main(string[] args) {
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Text;namespace 字串{ class Program { static void Main( string[] args ) { //字串頻繁分配記憶體示範(不推薦) //以下代碼將字串全總向後移一個值,原來的字串將會被替換成新加密後的.
Time of Update: 2018-12-03