Skip to content

Instantly share code, notes, and snippets.

@hunandy14
Last active May 19, 2016 10:21
Show Gist options
  • Save hunandy14/18021765168109eab0045b697279ca4c to your computer and use it in GitHub Desktop.
Save hunandy14/18021765168109eab0045b697279ca4c to your computer and use it in GitHub Desktop.
除錯
/**********************************************************
Name :
Date : 2016/05/19
By : CharlotteHonG
Final: 2016/05/19
**********************************************************/
#include <iostream>
/*=======================================================*/
using namespace std;
int element[]={5,-2,4};
template <typename T1, typename T2>
class Demo {
public:
// Demo<T1,T2>(const T1 &p, const T2 &n);
Demo<T1,T2>(const T1 &p, const T2 &n) {
this->ptr = p;
this->len = n;
}
// private:
T1 ptr;
T2 len;
};
// Demo<T1,T2>::Demo<T1,T2>(const T1 &p, const T2 &n) {
// this->ptr = p;
// this->len = n;
// }
int main(int argc, char const *argv[]){
Demo<int*, int> arr(element,3);
cout << "arr = " << arr.len << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment