摘要:
关键是如何把MFC中代表整数的控件,让我想把他换为0-1之内的小数时,如何改变原来的代码,使二者在实现上没有多大差别,这是个问题啊,看来得努力了! 阅读全文
摘要:
#include <string>#include <iostream>#include<vector>using namespace std;int main(){ vector<int> a(10,0); for (size_t i = 0; i < a.size(); ++i) { a[i] = i+1; }} 阅读全文
摘要:
普通数组:#include <string>#include <iostream>#include<vector>using namespace std;template<class T>bool is_equal(T *a, int size_a,T * b, int size_b){ if (size_b !=size_a) return false; for (int i = 0; i < size_a; ++i) if (a[i] != b[i]) return false; return true;}int main(){ int 阅读全文
摘要:
用模板写一个:#include <string>#include <iostream>#include<vector>using namespace std;template<class T>T* copy(T *a,int size){ T* b = new T[size]; for (int i = 0; i < size; ++i) { b[i] = a[i]; } return b;}int main(){ int a[] = {1,2,3,4}; int size = sizeof(a)/sizeof(*a); int *b = 阅读全文