test
This commit is contained in:
parent
18548eaba4
commit
27ea61203a
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
* 02_CPP06.cpp
|
||||||
|
*
|
||||||
|
* Created on: 21.06.2018
|
||||||
|
* Author: hendrik
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
template<typename T, int s> class myarray {
|
||||||
|
private:
|
||||||
|
T* aptr;
|
||||||
|
unsigned int uisize;
|
||||||
|
public:
|
||||||
|
myarray(unsigned int pUisize) {
|
||||||
|
aptr = new T[uisize = s];
|
||||||
|
}
|
||||||
|
|
||||||
|
myarray() {
|
||||||
|
aptr = new T[uisize = s];
|
||||||
|
}
|
||||||
|
|
||||||
|
~myarray() {
|
||||||
|
delete[] aptr;
|
||||||
|
}
|
||||||
|
T& operator[ ](int iindex) {
|
||||||
|
return (aptr[iindex]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
|
||||||
|
myarray <int, 10> intarray;
|
||||||
|
|
||||||
|
cout << "End";
|
||||||
|
}
|
Loading…
Reference in New Issue