Time of Update: 2015-06-01
標籤:1.#include"stdio.h"問題在64位系統下,編寫一個C程式,使用gcc,進行編譯時間,會出現error:stdio.h:沒有那個檔案,解決辦法:在命令列輸入sudo apt-get install build-essential進行安裝參考:http://blog.csdn.net/yygydjkthh/article/details/41787049 2.warning:incompatible implicit declaration of built-in
Time of Update: 2015-06-01
標籤:為了方便用VIM編程,安裝了一個方便的小工具 taglist,下面是taglist使用的一些說明。常用的taglist配置選項,可以根據自己的習慣進行配置: Tlist_Ctags_Cmd選項用於指定你的Exuberant ctags程式的位置,如果它沒在你PATH變數所定義的路徑中,需要使用此選項設定一下;
Time of Update: 2015-06-01
標籤:c++ 虛繼承 虛函數 一、虛繼承情況下類的記憶體大小計算當每個基類中有多個虛函數時,並且在虛繼承的情況下,記憶體是如何分配的,如何計算類的大小,下面舉例說明:#include<iostream>using namespace std;class A{ public: int a;
Time of Update: 2015-06-01
標籤:冒泡排序 字元排序 #include <stdlib.h>#include <stdio.h>#include<string.h>void main(){char str[50];int i,j,len;printf("請輸入字串:");scanf("%s",str);len=strlen(str);//計算你輸入的字串的長度if(len>5
Time of Update: 2015-06-01
標籤:字串排序 冒泡 選擇 #include<stdio.h>#include<string.h>#include<stdlib.h>#define N 256 //宏定義int main(){char strArray[N][256];char *str[N];char *temp;int
Time of Update: 2015-06-01
標籤:排序#include <stdio.h>#include "stdlib.h"#define N 256 //宏定義//比較兩個字串的大小int str_compare(const char* src,const char* dst){int ret = 0;if (src == dst){return 0;}if (dst == NULL){return -1;}while (!(ret = *(unsigned char*)src -
Time of Update: 2015-06-01
標籤:動態分配記憶體 排序 //動態分配記憶體對輸入的任一字元串排序#include<stdio.h>#include<stdlib.h>#include<malloc.h>#include<string.h>//比較大小//int str_compare(const char* src,const char* dst)//{//int ret = 0;//if (src ==
Time of Update: 2015-06-01
標籤:C++中,explicit關鍵字用於修飾單參數的建構函式,用於避免隱式類型轉換。例如,當不適用explicit關鍵字修飾類的建構函式時:class A{public: A(int initalValue=0);private: int storedValue;};此時,主函數代碼:int main(){ A m =3;}main函數是可以正常啟動並執行,但是當用explicit修飾建構函式時,class A{public: explicit A(int
Time of Update: 2015-06-01
標籤:資料結構 雙鏈表 操作 類模板 c++ //【資料結構】用C++實現雙鏈表的各種操作(包括頭刪,尾刪,插入,逆序,摧毀,清空等等)//標頭檔#ifndef _LIST_H#define _LIST_H#include<iostream>using namespace std;template<class
Time of Update: 2015-06-01
標籤:雙迴圈鏈表 c++ 資料結構 類模板 操作 //【資料結構】用C++實現單迴圈鏈表的各種操作(包括頭刪,尾刪,插入,逆序,摧毀,清空等等)//標頭檔#ifndef _CDLIST_H#define _CDLIST_H#include<iostream>using namespace
Time of Update: 2015-06-01
標籤:棧 資料結構 操作 類模板 c++ //【資料結構】用C++編寫棧及基本操作(包括入棧,出棧,獲得棧頂,摧毀,清空等等)//標頭檔#ifndef _SEQ_STACK_#define _SEQ_STACK_#include <iostream>using namespace std;template
Time of Update: 2015-06-01
標籤:隊列 c++ 資料結構 操作 類模板 //【資料結構】用C++編寫隊列及基本操作(包括插入,出隊列,摧毀,清空等等)//標頭檔#ifndef _SEQ_STACK_#define _SEQ_STACK_#include <iostream>using namespace std;template
Time of Update: 2015-06-01
標籤:日期#include <iostream>#include <algorithm>#include <cmath>using namespace std;struct Date{ int year; int month; int day; Date(int y = 0, int m = 0, int d = 0): year(y), month(m), day(d) {} Date & readIn()
Time of Update: 2015-06-01
標籤:(一)有時候為了讓一個對象盡量小,能夠把資料放在另外一個輔助的struct中,然後再讓一個類去指向它。看以下的代碼:class Point {public:Point(int x, int y);void setX(int newVal);void setY(int newVal);};struct RectData {Point ulhc;Point lrhc;};class Rectangle {public:Point& upperLeft() const { return
Time of Update: 2015-06-01
標籤:C++的記憶體劃分為棧區、堆區、全域區/靜態區、字串常量和代碼區。 這裡去掉自由儲存區,增加了代碼區,理由會在下面講到。 棧區:由系統進行記憶體的管理。 說明:主要存放函數的參數以及局部變數。棧區由系統進行記憶體管理,在函數完成執行,系統自行釋放棧區記憶體,不需要使用者管理。整個程式的棧區的大小可以在編譯器中由使用者自行設定,預設的棧區大小為3M。 全域/靜態區:全域、待用資料存放在一起的,初始化的全域變數和靜態變數是在一起的。未初始化的全域變數和靜態變數是在相鄰的空間中。
Time of Update: 2015-06-01
標籤: 眾所周知貓生貓,狗生狗,貓不可能生出狗來。同樣的實體是一種強型別關係,經常會因類型寫錯而報錯。無非是一點一點的排除找錯,但是ViewModle中,你會去看嗎? 有一種錯誤叫“AutoMapper.AutoMapperMappingException”類型的異常在AutoMapper.dll
Time of Update: 2015-06-01
標籤:interface IPrint { void Print(); } class A : IPrint {
Time of Update: 2015-06-01
標籤:簡單的說: 在C#中 str.Split("===="); //這樣是錯誤的,只能 str.Split(‘=‘);//參數只能是char類型的,不能是字串的 如果非得要以字串分割,那麼請用: string content = "I love you=====do you know===shit"; string[] sArray = null;
Time of Update: 2015-06-01
標籤:一、String.EmptyString類的靜態唯讀欄位。定義如下:public static readonly string Empty;二、“”被賦值為“”的字串變數,會在棧上儲存一個地址(佔4個位元組),該地址會指向
Time of Update: 2015-06-01
標籤:驗證:一、RequiredFieldValidator:非空驗證ErrorMessage:驗證出錯時顯示的錯誤資訊ControlToValidate:要驗證的控制項IDDisplay:呈現模式。Static-靜止,不顯示也會佔空間。Dynamic-動態,不顯示不佔空間InitialValue:控制項的初始值,如果驗證出來的值與初始值相同,則也是判斷為空白兩種非空的形式:1.什麼內容都沒有ErrorMessage,ControlToValidate,Display2.初始值沒變ErrorMe