My wish is to pass larger number than long long (64bit) to function.
For passing long long we have to but L to the end of the number but
the question is that can i create my own custom tag or sign to handle
even bigger number?
example:
1 2 3 4 5 6 7 8 9 10 11
// long long
void longlongfunc( longlong in );
// my own invention
void myintfunc( myint in );
int main() {
longlongfunc(8589934592L);
myintfunc(1099511627776M);
return 0
}
Edit:
I found out that what i wanted is suffix number and i found out that
the max value of it can be long long or unsigned long long.
Is there any trick or something that i could pass a number like this:
1099511627776 for example.
... but you still need a type that can handle large numbers like that. Create your own class that uses multiple integer values internally, or use a library like GMP or Boost.Multiprecision.
as i understood correctly that there is just no way to do this:
myintfunc(1099511627776M);
Because the largest thing that can be is long long as there were told.
I can create class that hold 128 or more bit value easily but using this = operator
to set is not the option then?
The only way would be = "1099511627776"
Am i right or is there another way?
You can do myintfunc(1099511627776_M); (note the underscore, user-defined literals must use it). And yes, your operator""_M will have to return some custom type (or at least a boost multiprecision type) (Edit: if that number were actually too big for 64 bit, thank you Peter87!)