I am very new to C++ and I'm having issues with making a class.
So I have this pad class and it has double inputs of the x and y coordinates for the sides of the pad. To elaborate, say you had a pad of 2cmx2cm it would have pad({0.0,2.0},{0.0,2.0}). I wanted to set the default constructor to be a pad of 0x0.
class pad {
public:
double xcor[2] = {0, 0};
double ycor[2] = {0, 0};
double charge = 0;
pad() = default; // put this for now to work on code that works with the
// pad object
pad(double xcord[], double ycord[]) {
for (int i = 0; i < 2; i++) {
xcor[i] = xcord[i];
ycor[i] = ycord[i];
}
}
};