A quick question on arrays.

This is a discussion on A quick question on arrays. within the C++ Programming forums, part of the General Programming Boards category; Hi, just learning c++ here and i'm having a problem with arrays. I can't seem to make an array with ...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    3

    A quick question on arrays.

    Hi, just learning c++ here and i'm having a problem with arrays.
    I can't seem to make an array with more than 200,000 slots without somesort of runtime error. It compiles fine, but messes up when I try to run the program. Was just wondering if someone can figure out what i'm doing wrong.

    code like this:

    ====================================

    unsigned long int array[2000000]; //would give me an error

    unsigned long int array[200000]; //won't give me an error

    ====================================

    if anyone can help me with this i'd be very thankful.
    (and no it isnt a lack of ram, i have 1gig)
    Last edited by Junon; 09-02-2002 at 03:11 PM.

  2. #2
    Registered User
    Join Date
    Sep 2002
    Posts
    3
    I am using a 32-bit compiler. Its microsoft visual c++ 6.0, running on a win2k box. The program itself times sorted array searchs using a linear search and a bi-linear search. While I know which runs faster just by using the Big-oh algorythm. The problem is that i need a sizable array to be able to to get any time over 0s using either of the array search methods. Anyway, its just driving me nuts that i cant get the program to run without a runtime error.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Comparing Arrays question
    By taugust7 in forum C++ Programming
    Replies: 36
    Last Post: 04-14-2009, 01:29 PM
  2. Quick File Input Question
    By ProjectsProject in forum C Programming
    Replies: 2
    Last Post: 11-04-2004, 11:39 AM
  3. Quick Question on File Names and Directories
    By Kyoto Oshiro in forum C++ Programming
    Replies: 4
    Last Post: 03-29-2002, 02:54 AM
  4. * quick question *
    By SavesTheDay in forum C Programming
    Replies: 3
    Last Post: 03-27-2002, 06:58 PM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 06:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21