Answer to Question #13638 in C++ for Chad Dylan Cooper

Question #13638
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
Expert's answer
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS