class MyFloat
{
private:
enum {MAX_DIGITS = 20};
char Number[MAX_DIGITS + 1];
char NumberOfDigits;
public:
void Write();
friend void AssignValue(MyFloat& X);
};
void MyFloat::Write( )
{
int i;
if(!NumberOfDigits == 0)
{ cout << "0.";
for(i=0; i<NumberOfDigits + 1; i++)
cout << int (Number[i]);
}
else
cout << "0.?";
}
this is the code that i am working with. the problem i am having is that i want to display a decimal with the first number as a 0, but it keeps coming up as -52. Number of Digits is initialized in the other function as 3 and the array is Number[1]=1, Number[2]=2, and Number[3] =3. If you wanna kown more, just ask. But i dont know what it is doing at all!