Time of Update: 2015-04-07
標籤:1、常用的T-Sql語句 查詢:SELECT * FROM tb_test WHERE ID=‘1‘ AND name=‘xia‘ SELECT * FROM tb_test
Time of Update: 2015-04-07
標籤:不使用virtual實現多態可以用成員函數指標完成。成員函數指標形式:傳回型別(A::*指標名)(形參表) 其中A是類類型,即這個指標是指向A類的成員函數的函數指標
Time of Update: 2015-04-06
標籤:在C++中定義一個數組:int a[5]={1,2,3,4,5}那麼a到底代表什麼含義呢?首先想到的是a代表的是數組的首元素地址。那麼如果問你a的類型是什麼呢?估計很多人就不太確定了,看下面程式,讓編譯器告訴我們a是什麼類型的資料:main.cpp如下:從圖片中的錯誤提示可以看出:a的類型是int [5]類型。那麼直接將a賦值給一個int
Time of Update: 2015-04-07
標籤:資料結構cc++ c++感悟 迷宮 管理 遍曆 今天老師讓做了個迷宮問題,我一看到就發現和我之前寫過的一個程式是一樣 的,但是在後來編寫的時候有一個地方搞錯了,最後下課了我還是沒有正確的編寫好,然後今天回來之後自己有看了一下,現在已經解決了。#ifndef DIRECTION_H#define
Time of Update: 2015-04-06
標籤:發訊息using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;using System.Messaging;namespace
Time of Update: 2015-04-07
標籤:sdfsdfsd continue register 關鍵字 fsdfsdf C語言的關鍵字包括:(32個)auto double int struct break else long switchcase enum register
Time of Update: 2015-04-06
標籤:直接 貼代碼。 代碼也很簡單,有什麼不會的跟帖留言。 #include <stdio.h>#include <string.h>#include <windows.h>/*#include "stdafx.h"#pragma comment(linker,"/subsystem:windows /entry:mainCRTStartup")void exit(){MessageBox(NULL,"wifi即將退出。","wifi",0);}*
Time of Update: 2015-04-06
標籤:迴文字串 strlen #include<stdio.h>;#include<string.h>;void huiwen( const char* str){int i;int flag;int len=strlen(str);char *ch=str;while(*ch!='\0'){ch++;}ch--;for(i=1;i<=len/2;i++){if(*ch==*str)
Time of Update: 2015-04-06
標籤:可變參數列表 printf c語言 //用可變參數列表實現printf函數#include <stdio.h>#include <stdarg.h>void my_printf(const char *str,...){va_list fun;va_start
Time of Update: 2015-04-06
標籤:字串 反向排列 遞迴 c語言 //編寫一個函數reverse_string(char * string)(遞迴實現)//實現:將參數字串中的字元反向排列。//要求:不能使用C函數庫中的字串操作函數。#include <stdio.h>#include <assert.h>void reverse_string(char const
Time of Update: 2015-04-07
標籤:cpp說白了c++中的引用就是指標。。至少底層實現是這樣。。一個例子說明。。一下#include <stdio.h>int main(int argc , char *argv[]){int a = 9;int *b = &a;int &c = a;++c;*b += 2;return 0;}1: #include <stdio.h>2:3: int main(int argc , char *argv[])4: {
Time of Update: 2015-04-07
標籤:std::vector 是向量數組,可以自動成長,標頭檔:#include <vector>std::array C++11中新型容器,需要指定數組的長度,標頭檔:#include <array>。 1 vector<int> vInts; 2 for(int i=0;i<10;i++) 3 { 4 vInts.push_back(i); 5 } 6 for(auto
Time of Update: 2015-04-06
標籤:最近幾節課學的知識點的量有很大增長,加上上機和托福考試的臨近,這裡練習的所有代碼就不走形式全貼出來了,找我自己覺得又不熟悉的點貼出來,爭取簡明扼要,恩恩這次主要看介面的問題:介面可以多繼承,有些時候我們可能需要解決命名空間衝突。而從此我們得到的結果為:這裡就發現問題了。。。只提供一個Draw()方法的實現,導致了兩個介面都使用該成員作為它們的實現。所以我們嘗試用顯式的介面來完成這個功能的實現:其實質是解決命名空間衝突從此我們可以得到結果了:所以:隱式實現介面,介面和類都可以訪問類中的方法;
Time of Update: 2015-04-06
標籤:這次的部落格記錄的是寫crc校正碼的過程。過程十分坎坷,好不容易快整完了結果虛擬機器崩了,程式也沒了,只好重新來過。。。首先是控制台應用程式的代碼。 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 using System.IO; 7 8 9 namespace
Time of Update: 2015-04-06
標籤:1.Interface 定義結構1 [attributes] [access-modifiers] interface interface-name [:base-inteface-list] 2 { 3 interface body 4 }[attributes] 性質 (可選項);[access-modifiers] 存取修飾詞 (可選項);//public internal private protected
Time of Update: 2015-04-06
標籤: 將秒數轉化成任意時間格式,可以使用C#的一個函數TimeSpan,看樣本: TimeSpan ts = new TimeSpan(0, 0, 3661); richTextBox2.Text = ts.Hours + "小時" + ts.Minutes + "分鐘" + ts.Seconds + "秒"; 也可以使用傳統的方法,看樣本: int TotleTime=3661;//秒
Time of Update: 2015-04-07
標籤:一. .net framework 的特點 1.兩個主要組件 1> CLR 表示運行時的環境,同時也保證了.net 中的一種一種語言具有的功能其他語言也都具有; 2> 統一的類庫集&
Time of Update: 2015-04-06
標籤: 上節課我們學習了介面。 在類及其客戶之間建立協定方面,介面是抽象類別之外的另一種選擇;他們之間的區別是抽象類別往往是一系列衍生類別的基類,而介面的作用是將協定混入其他繼承樹。 關鍵字 interface後是介面的名字。一般介面名的首字母都是I(但不是必虛的)。 介面主題描述了實作類別必須實現的方法、屬性,等等。 使用簡單的介面: using Systemnamespace SimpleInterface{ interface
Time of Update: 2015-04-07
標籤:for語句 執行個體 c if語句 通過學習if條件判斷和for迴圈之後,做了一個執行個體。實現的執行個體都在代碼中有詳細的注釋。#include <stdio.h>/****************************************************** * 輸入一個數字n,求 * 1+1+2+1+2+3+1+2+3+4.
Time of Update: 2015-04-07
標籤:執行個體 for語句 c語言 九九乘法表 為了加深對C語言中for迴圈的理解,學習執行個體寫出了九九乘法表,相對來說比較簡單。#include <stdio.h>/************************************** * 本執行個體用於輸出一個九九乘法表 * 用於繼續練習for語句 *******************