Created
April 16, 2013 19:48
-
-
Save madbence/5399008 to your computer and use it in GitHub Desktop.
Szoftver laboratórium 2, 10. labor, 15. feladat
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
Array<int, 20> t(1); | |
t.at(8) = 12; | |
for (size_t i = 0; i < 8; i++) | |
cout << t.at(i) << endl; | |
//konstruktor: | |
explicit Array(size_t n = maxsiz, const T& value = T()) : siz(0) { | |
// default értékkel feltölti a tömb méretéig, utána tényleg memóriaszemét lesz! | |
// Ha kitöröljük, tényleg nem 0-kat kapunk... | |
while (siz < n && siz < maxsiz) | |
t[siz++] = value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment