I'm sorry for creating a second thread for the same topic.
I'm a newbie so I'm sorry if I didn't recognize it as the same topic.
Thanks for the web link. It has a really cool selection of information.
modf()
Can modf() be used to split a Hugeint into it's seperate integers?
say I want 12345 to be split into 1,2,3,4, and 5.
modf(12345,Name of pointer);
The way I'm currently doing seems like to much to type *lazy*. See below.
Code:
//prototype
bool TestInteger(int*,const int,int*)
//member function call
TestInteger(Num1,SIZE,Buffer1)
//member function definition
bool HugeInteger::TestInteger(int *Array,const int SIZE,int *Num)
{
for(x=0;x<SIZE;x++)// devides integer
{
Array[x]=*Num%10;
*Num/=10;
}
for(x=0;x<SIZE;x++)
{
if(Array[x]<'48'&&Array[x]>'57')
{
cout<<"Data FAILED Integer confirmation!!"<<endl;
return false;
}
}
cout<<"Data PASSED Integer confirmation"<<endl;
return true;
}
This doesn't work
Can you see any logic error in this?
I'm trying to test every location of the array for valid data. It doesn't prevent errors from inputing invalid data.
I want it to error out on digits like (e.g. 123e3, 1234\3, etc.)
A test for typos kind of thing