Rip_Van_Winkle's blog

By Rip_Van_Winkle, history, 9 years ago, In English

Codeblocks doesn't allow me to declare a long long type array size of 5*10^8. Can I somehow change the compiler settings to declare such large global array?

  • Vote: I like it
  • -2
  • Vote: I do not like it

| Write comment?
»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Emm, it will cost (5 * 10^8 * 8) / 1024 / 1024 -> 3814,697265625 megabytes.

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Your question provides too little information.
What's your operating system? 32 or 64bit?
What's your compiler?
Is there a sample code?

Besides that, Codeblocks is an IDE, not a compiler.

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    OS is 64 bit and i'm using a gnu gcc compiler. actually i was trying to do the precalculation part of this problem and save it in a file. I couldn't think of a way to do it without creating a 5*10^8 array :(

»
9 years ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

I think the point of such problems is to find another way of storing or even not storing this data and still solve it.