#include #include #include "custom_array.h" using namespace std; //template function template void swap_things (T& a, T& b){ T temp = a; a = b; b = temp; } int main() { // //floats // float f1 = 5.0, f2 = 6.8; // swap_things(f1, f2); // //swap_things (f1, f2); // cout << f1 << endl; // cout << f2 << endl; // //strings // string s1 = "hello world", s2 = "cs162"; // swap_things(s1, s2); // //swap_things(s1, s2); // cout << s1 << endl; // cout << s2 << endl; // //ints // int i1 = 8, i2 = 4; // swap_things(i1, i2); // cout << i1 << endl; // cout << i2 << endl; //template class Custom_Array arr (10); for (int i = 0; i < 10; ++i) { arr[i] = i * 2.5; } cout << "Length: " << arr.getLength() << endl; for (int i = 0; i < 10; ++i) { cout << arr[i] << endl; } return 0; }