định nghĩa Contructor của em
cGrandInt::cGrandInt(char* str)
{
int j =0;
if(str[0] == '-')
{
mSign = false;
mGrand = new char[(strlen(str))-1];
for(int i = 1; i < strlen(str); i++)
{
// int j = 0;
mGrand[j] = str[i];
j++;
}
}
else
{
mSign = true;
mGrand = new char[strlen(str)];
for(int i = 0; i < strlen(str); i++)
{
mGrand[j] = str[i];
j++;
}
}
}
và hàm show
void cGrandInt::show_GrandInt()
{
if(mSign == true)
{
cout << mGrand;
}
else if(mSign == false)
{
cout << "-" << mGrand;
}
cout << "\n\n";
}

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?