Compare commits
2 Commits
f684460a57
...
27ea61203a
Author | SHA1 | Date |
---|---|---|
localhorst | 27ea61203a | |
localhorst | 18548eaba4 |
|
@ -27,7 +27,7 @@ void f3(unsigned int i) {
|
|||
|
||||
int main() {
|
||||
|
||||
int uiselected = 2;
|
||||
int uiselected = 1;
|
||||
void (*f_array[])(unsigned int) = {f1, f2, f3};
|
||||
|
||||
unsigned int params[] = {100, 2, 50};
|
|
@ -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