Xref: news-dnh.mv.net comp.lang.c++:59180 comp.os.msdos.djgpp:3498 Path: news-dnh.mv.net!mv!news.sprintlink.net!news.uoregon.edu!newsfeed.internetmci.com!in2.uu.net!news.sandia.gov!tesuque.cs.sandia.gov!lynx.unm.edu!bubba.NMSU.Edu!paris!jshagam From: Quantum Porcupine Newsgroups: comp.os.msdos.djgpp,comp.lang.c++ Subject: Re: Declaring arrays inside generic function Date: Tue, 28 Nov 1995 21:04:09 -0700 Organization: New Mexico State University Lines: 34 References: Nntp-Posting-Host: paris.nmsu.edu To: djgpp AT sun DOT soe DOT clarkson DOT edu Dj-Gateway: from newsgroup comp.os.msdos.djgpp On Mon, 27 Nov 1995, Michael E. Wesolowski wrote: > I don't know if this is a problem with gcc, the DOS port of gcc, or > something (i.e., not a bug) in the implementation that I don't know > about. I'm using the DOS port of gcc (djgpp), v1.12m4. This is equivalent > ot gcc 2.6.3, if I remember correctly. > > I have a generic function which has as one of its input parameters an int > which identifies an array size. Within the function, I attempt to declare > an array of int's: > > int item_count [array_size]; > > where array_size is the input parameter. When I look at the array in the > debugger (gdb) however, what i see is an array of int pointers (I think) > - something like int (*) [60000] (the 60000 is approximate). If I > explicitly declare the array as, for example, item_count [10], I get the > expected array of 10, uninitialized ints. SO, what's the problem? > > If it's something in the ANSI standard, I'd appreciate the paragraph > reference as well as a simple description of what's going on. Thanks. > That's probably due to the old 64k segment limit imposed by DOS... it's probably just splitting it across many segments like any coder who's worked in realmode (yeah, I know, this is pmode, weird huh?) has done many times... ________________________________________________________________________ / Joshua Shagam / (Quantum Porcupine / Versatile) / / mailto:JShagam AT nmsu DOT edu / http://web.nmsu.edu/~jshagam / / phone://1.505.645.3856/~joshua / for the Quantum Porcupine Archive / /__________________________________/____________________________________/ Stop the execution of King Louis XIV! If you agr-- oops, too late! :)