Respuesta :

tonb

Strictly speaking, the c++ program does not create a Pair class, but instantiates a Pair object that can store two objects as declared as generic types. Is that what you meant? (Otherwise you're looking at static members which doesn't make sense for a pair class).

class Pair

{

public:

int number;

double factor;

};



int main()

{

Pair A;

A.number = 42;

A.factor = 2.6;

return 0;

}