原创 數組名的sizeof 與數組作爲函數參數的sizeof
#include <stdio.h> using namespace std; //字符串反轉 int a[]={4,5,6}; int sum(int b[],int len) { int i,result=0; for(i=0;i<l
原创 公務員 國考資料
http://yun.baidu.com/share/home?uk=1027035554&view=share#category/type=0
原创 紋理分割相關文獻
1. unsupervised image segmentation of color-texture regions in images and video 2001 原文下載鏈接 http://vision.ece.ucsb
原创 反轉 字符串
void reverseWords(string &s) { string rs; for (int i = s.length()-1; i >= 0; ) { while (i >= 0 && s[i] == ' '
原创 C++ 虛函數
class Base { public: void f1() { printf("Base::f1()\n"); } virtual void f2() { printf("Base::f1()\n"); } }; cla
原创 最近比較火的發表在science上的聚類算法的一些資源
http://eric-yuan.me/clustering-fast-search-find-density-peaks/ https://gist.github.com/jdeng/d2c538e4cab6dd75bf34 一些源碼
原创 編寫一個循環將list容器的元素逆序輸出
#include<iostream> #include<list> using namespace std; int main() { int ia[5]={1 , 2 , 3 , 4 , 5}; list<int>
原创 C++ static
int sum(int a) { int c=0; static int b=3; c+=1; b+=2; return(a+b+c); } void main() { int I; int a=2; for(I=0;I<5;I++)
原创 數據庫入門的好資料
http://www.w3school.com.cn/sql/sql_distinct.asp
原创 運算符優先級
int main() { int a=5,b=3,n=2; int E=(a<b&&n++||(n=n+10)); cout<<E<<endl; cout<<n<<endl; return 0; } 輸出表達
原创 迭代器的算術操作
除了一次移動迭代器的一個元素的增量操作符外,vector迭代器(其他標準庫容器迭代器很少)也支持 其他的算術操作.這些操作稱爲迭代器算術操作(iterator arithmetic),包括: iter+n iter-n
原创 三種繼承方式的區別
class parent { public: parent(int var=-1) { m_npub=var; m_nptd=var; m_nprt=var; } public: int m_npub; protecte
原创 虛函數與虛繼承
http://www.cnblogs.com/fanzhidongyzby/archive/2013/01/14/2859064.html
原创 strlen
char s[]="\\\0923"; cout<<strlen(s)<<endl; 輸出爲 1 因爲第二個字符就是\0 空 strlen 遇到空 就結束 計算 字符的個數應該是4 \\ 轉義 sizeof(s) 結果
原创 單個字符串反轉
int main() { string str; cout<<"Please input string:"; cin>>str; string::size_type len=str.size();