user'll only be able to enter predetermined vals

<code>
#include <iostream>

using namespace std;

int main
{
char A[12]="47000000000";
char B[12]="47000000000";
char C[12]="47000000000";
cout << "Enter 3 numbers to multiply(1-13 digits): ";
cin >> A[11];
cin >> B[11];
cin >> C[11];
char D[39]="10382300000000000000000000000000000000";
cout << D << D[38] << endl;
cin >> D[38];
}
</code>

What changes should I make to the computer program above
to allow the user to enter any values that fits within the
array sizes: [12] , [12] , [12] , [39] .
Last edited on
You can use unsigned long double data type.

PS: Please use code tags...
Last edited on
I did use (code tags) you should have paid attention to the contents of my first post!
Because if you did, you would see them right where they need to be.
Last edited on
@cppnerd. Your Post Does not have code tags in any way shape or form. Look closer...

With Code tags:

int x = 5;

Without:

int x = 5;
Last edited on
code tags are used by [ code ] [ /code ] (ignore the white spaces) and not by <code> </code>

I think your habit of using <> is because of html, isn't it @cppnerd?
programmer007 wrote:
unsigned long double


What is that? Not a legal C++ type I am sure.

There are external libraries like GMP and many others, that will handle arbitrarily large integers. Check out Boost as well.

http://en.wikipedia.org/wiki/List_of_C%2B%2B_multiple_precision_arithmetic_libraries
http://www.boost.org/doc/libs/1_53_0/libs/multiprecision/doc/html/boost_multiprecision/intro.html


Hope all is well :+)
I believe this is what you're looking for:
http://en.cppreference.com/w/cpp/io/basic_istream/readsome

-Albatross
@cppnerd. Your Post Does not have code tags in any way shape or form. Look closer...

yes he does. they just arent cplusplus.com compliant.

What is that? Not a legal C++ type I am sure.

certainly not.

There are external libraries like GMP and many others, that will handle arbitrarily large integers. Check out Boost as well.
those are good recommendations. for further research you can google bignum libraries op
my bad...
unsigned long int

will that work?
@programmer007

No. Look up the maximum value for that type and see how many digits it has :+)

One needs a library to do this because the largest unsigned value (64 bit) is still not big enough.

Regards :+)
Just curious
Which is the most precise data type (within standard library)???
@programmer007

Well, on a 64 bit machine unsigned long long int

But it is better to use a cstdint.h type like uint64_t (platform independent). The maximum is still 64 bit which is about half of what the OP requires.
thanxx @TheIdeasMan...
Topic archived. No new replies allowed.