Memory problem using MSC V5.1

ecddoc at RAMSTEIN2-EMH.ARPA ecddoc at RAMSTEIN2-EMH.ARPA
Fri Aug 12 16:38:02 AEST 1988


I have a problem.  I am in the process of translating a mainframe COBOL
program to an IBM PC C program.  I am working on a Z-248 running OS/2 and
MSC V5.1 compiler.  The program uses 15 files (including indexs) and a number
of arrays, two of which are extremely large.  The main program access all
arrays and files on a continuous basis, so it is not possible to open and
close them.  My problem is this.  The program works fine, but when I try to
add data to the files, it will only allow 2 and sometimes 3 records to be 
added, then crashes.  Below is the loop I am using to load the array.
        while (answer == 1)
        (  
                clear_artmi_array();   stores zeros and blanks to array
                clear_artmi_display();  clears the display on screen
                artmi_enter();         actually loads the array
                if (btAdd(artmifd, &art_mi) != GOOD)
                        err_warn("Can't add to ARTMI.","");
                btSync(artmifd);
                CUR_MV(22, 1); clrline();
CUR_MV(22, 1); printf("< > Retuirn = 0, Continue = 1");
                kbflush();
                nprompt(&answer, "#", 0L, 1L, OPT, 22, 2);
                if (answer != 0)
                  answer = 1;
        )
My problem is, when I loop through here, I think the compiler is 
allocating memory for use by the array.  Each time through, it does
this until the system runs out of memory.  Does this make sense?
Where can I reference use of memory for functions?  I have taught
myself C so I am ;sure it is my programing and not the compiler.
Any suggestions would be most welcome, either here or E-Mail.

Dennis Martin
ecddoc RAMSTEIN2-EMH.ARPA            |> ?|?|  



More information about the Comp.lang.c mailing list