Answer to Question #13638 in C++ for Chad Dylan Cooper
Write the C++ statement that declare an object e1 of type testClass, and initializes the instance variables of e1 to 10 and 65.5 respectively.
1
2012-08-30T09:46:34-0400
#include <iostream>
using namespace std;
class TestClass{
int i;
float f;
public:
TestClass(int _i, float _f):i(_i),f(_f){}
};
int main(){
TestClass e1(10,65.5);
return 0;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment