
56 C++ Programming
int main()
{
CuboidMetal c[3]={
CuboidMetal("Silver",10,9.5,2.8,2793,10.5),
CuboidMetal("Gold",7.1,5.8,9.1,7103,19.3),
CuboidMetal("Platinum",10,9.5,2.8,5400,21.4)
};
for(int i=0;i<3;i++)
c[i].DeterminePurity();
}
2.7 Class: Interface and Implementation
Do not get confused! Interface is nothing but a class definition, while implementation contains
definitions of non-inline member functions of a class and attributes
9
definitions if any. Generally,
the developer of the class provides interface (header file .h) and object file (.obj) to the user of a
class. Hope you remember that the object file is generated after the compilation ...