Arbitrary size integers in C/C++

后端 未结 5 704
眼角桃花
眼角桃花 2020-12-31 21:52

Question

  • Is there a way to create a arbitrary size integer using c/c++?

For example:

int main(void) {
  Int i = Int(3); //3-bit i         


        
5条回答
  •  难免孤独
    2020-12-31 22:16

    No, size of every primitive element (int,short,long...) depends of hardware architecture.

    For bigger sizes, you should use one Big Integer library (they represent numbers with strings).

提交回复
热议问题