Answer to Question #12589 in C++ for sofiya sabri
find error
# include <iostream.h>
class xyz
{
private:
int d1;
float d2;
public:
void xyz ()
void display ();
};
void main ()
{
xyz s;
s.showdata();
}
1
2012-08-09T07:42:19-0400
There should be implementation of the methods used:
#include
<iostream>
using namespace std;
class xyz
{
private:
int
d1;
float d2;
public:
xyz ()
{
d1 = 3;
d2 =
3.14159f;
}
void display ()
{
cout << "d1 = " << d1
<< endl << "d2 = " << d2 << endl;
}
};
int
main ()
{
xyz s;
s.display ();
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