Last active
May 19, 2016 10:21
-
-
Save hunandy14/18021765168109eab0045b697279ca4c to your computer and use it in GitHub Desktop.
除錯
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************************** | |
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