0

How to take very long input for binary?

I am making a program to convert binary into decimal for my school homework. I have assigned the input variable as 'long' data type, but, maximum input is till 10^10 and I want input for Binaries greater than 10^10. Any help would be grateful, thanks.

6th Apr 2017, 5:38 PM
Arihant Bedagkar
Arihant Bedagkar - avatar
4 Respostas
+ 1
you can use -> long long int it is biggest in build integer data type
6th Apr 2017, 5:43 PM
Aditya kumar pandey
Aditya kumar pandey - avatar
+ 2
or you can use vector better then array
6th Apr 2017, 5:47 PM
Aditya kumar pandey
Aditya kumar pandey - avatar
0
thanks, but I guess, for longer inputs than long long int, I should use array.
6th Apr 2017, 5:45 PM
Arihant Bedagkar
Arihant Bedagkar - avatar
0
yup, thanks
6th Apr 2017, 5:48 PM
Arihant Bedagkar
Arihant Bedagkar - avatar