Thread: global variables - size

  1. #16
    Tha 1 Sick RAT
    Join Date
    Dec 2003
    Posts
    271
    That is way too much memory to be allocating. Ominus is right, learn dynamic memory sooner, believe me it takes about a couple of minutes to know the basics about allocating dynamic memory; re-allocating on the fly however...... Well I knida try not to stray there. 'sides you have to know about dynamic memory if you are going to write anything serious.
    A hundred Elephants can knock down the walls of a fortress... One diseased rat can kill everyone inside

  2. #17
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,164
    Originally posted by WDT
    That is way too much memory to be allocating. Ominus is right, learn dynamic memory sooner, believe me it takes about a couple of minutes to know the basics about allocating dynamic memory; re-allocating on the fly however...... Well I knida try not to stray there. 'sides you have to know about dynamic memory if you are going to write anything serious.
    I just compiled the following code with BC5.5 and it worked fine:
    Code:
    #include<stdio.h>
    int main(void)
    {
        int test1[30000];
        int test2[30000];
        int test3[30000];
        int test4[30000];
    
        test1[29999] = 1;
        test2[29999] = 2;
        test3[29999] = 3;
        test4[29999] = 4;
        printf("%d %d %d %d \n", 
                    test1[29999],test2[29999],
                    test3[29999],test4[29999]);
    	return (0);
    }
    Definition: Politics -- Latin, from
    poly meaning many and
    tics meaning blood sucking parasites
    -- Tom Smothers

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. char Handling, probably typical newbie stuff
    By Neolyth in forum C Programming
    Replies: 16
    Last Post: 06-21-2009, 04:05 AM
  2. Global Variables, include files and classes
    By sharpstones in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2005, 10:06 AM
  3. Replies: 1
    Last Post: 09-05-2004, 06:42 PM
  4. global variables
    By rdnjr in forum Linux Programming
    Replies: 0
    Last Post: 01-07-2003, 10:28 AM
  5. GLobal variables
    By fuh in forum C++ Programming
    Replies: 21
    Last Post: 01-01-2003, 03:11 AM