title: Declaring large character array in c++
body: <p>I am trying right now to declare a large character array. I am using the character array as a bitmap (as in a map of booleans, <em>not</em> the image file type). The following code generates a compilation error.</p>
  
  <pre><code>//This is code before main. I want these as globals.
  unsigned const long bitmap_size = (ULONG_MAX/(sizeof(char)));
  char bitmap[bitmap_size];
  </code></pre>
  
  <p>The error is <em>overflow in array dimension</em>. I recognize that I'm trying to have my process consume a lot of data and that there might be some limit in place that prevents me from doing so. I am curious as to whether I am making a syntax error or if I need to request more resources from the kernel. Also, I have no interest in creating a bitmap with some class. Thank you for your time.</p>
  
  <p>EDIT
      ULONG_MAX is very much dependent upon the machine that you are using. On the particular machine I was compiling my code on it was well over 4.2 billion. All in all, I wouldn't to use that constant like a constant, at least for the purpose of memory allocation.</p>