-1

Is it possible to take an input of range greater than what C/C++ provides? Is it possible to accept an input range greater than that of unsigned long long and even larger up to the range of 10^1000? If it is possible in C/C++, please answer how it can be done, thanks.

Jarod42
  • 203,559
  • 14
  • 181
  • 302
lethal
  • 39
  • 2
  • 9

2 Answers2

8

There's no bigint in C or C++, however library like this one can provide it: https://code.google.com/p/infint/

CollioTV
  • 684
  • 3
  • 13
  • 3
    I don't think "simulate" is the proper verb here. It *provides* bigint functionality. – Jongware Sep 05 '14 at 10:47
  • Lol.., `C+++`? You probably want to write `C++` – Spikatrix Sep 05 '14 at 10:51
  • @CollioTV Thanks but can you guide me how to set this header file named InfInt.h for my compiler, i am using codeblocks, and while i paste this header file inside this (C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.8.1\include) path, the compiler still fails to identify the header file. – lethal Sep 05 '14 at 10:55
  • I'm really sorry but i'm not develloping on codeblocks... i don't really know how to import over library on this ide! @Jongware i'm sorry, english isn't my native language so id make mistake like this oftenly – CollioTV Sep 05 '14 at 11:04
  • 1
    No problem at all, and absolutely no need to apologize! We still understood what you meant. As far as English goes, "practice, practice, practice", and I consider SO a good place to do so! (You might find your answers may be improved 'silently', where someone edited your post. In this case I thought it wise to point out the difference; "simulate" is a valid term in programming, but it means something else.) – Jongware Sep 05 '14 at 14:37
4

Input into a string. Then convert the string into the desired type.

If you use a library that provides types for large integers, such a library might also offer input functions.

Oswald
  • 31,254
  • 3
  • 43
  • 68