Skip to content

Instantly share code, notes, and snippets.

@madbence
Created April 16, 2013 19:48
Show Gist options
  • Save madbence/5399008 to your computer and use it in GitHub Desktop.
Save madbence/5399008 to your computer and use it in GitHub Desktop.
Szoftver laboratórium 2, 10. labor, 15. feladat
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