Jump to

v02-l1-publicAttr

Which way defines a class with public attributes ?

// Solution A
class Rectangle {
    public double height;
    public double width;
}

// Solution B
class Rectangle {
public:
    double height;
    double width;
}

// Solution C
class Rectangle {
    double height;
    double width;
}

// Solution D
struct Rectangle {
    double height;
    double width;
}

???