global variables - size

This is a discussion on global variables - size within the C++ Programming forums, part of the General Programming Boards category; That is way too much memory to be allocating. Ominus is right, learn dynamic memory sooner, believe me it takes ...

  1. #16
    WDT
    WDT is offline
    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,156
    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

Page 2 of 2 FirstFirst 12
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, 09:28 AM
  5. GLobal variables
    By fuh in forum C++ Programming
    Replies: 21
    Last Post: 01-01-2003, 02:11 AM

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