TA - not ready
Exercise 1a
class MyClass{
int x,y;
public:
MyClass(){x=1; y=2; cout << " MyClass()"<< endl;}
MyClass( int new_x ){x= new_x; y=3; cout << " MyClass(int)"<< endl;}
MyClass( double new_x, double new_y ){
x= new_x; y=new_y;
cout << " MyClass(double, double)"<< endl;
}
string to_string(){
return "["+std::to_string(x)+","+std::to_string(y)+"]";
}
};
int main() {
MyClass a[4];
MyClass b[4] {11, 22};
MyClass c {11,21};
MyClass d();
MyClass f[5] {{11, 22}, 33, {55, 22}};
}Answer
output
TODO check the pointers in bytes
Exercise 1b
Answer
Exercise 2 - Makefiles
TODO
Exercise 3 - LinkedList
TODO
Last updated