Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!usc!wuarchive!udel!haven!adm!cmcl2!acfcluster.nyu.edu!zielinski From: zielinski@acfcluster.nyu.edu Newsgroups: comp.lang.c++ Subject: How to fread a long data stream? Message-ID: <1990Dec6.202843.1@acfcluster.nyu.edu> Date: 7 Dec 90 01:28:43 GMT Sender: news@cmcl2.NYU.EDU Organization: New York University Lines: 24 Problem: Using Turbo C++, getting fread to read a large number of data points (160,000 short integers). The following structure worked in (Microsoft) C, but fails in Turbo C++. It will only read 28,928 two-byte data; this corresponds to the remainder of 160000/65536. long NumPts=160000L; long NumRead; static short huge x[160000L]; printf("Array size is %ld\n",(long)sizeof(x)); /* OK up to here */ Numread=fread(x,sizeof(short),NumPts,file1); /* only reads 28,928 */ Then tried putting this in header before the #include's : #define _SIZE_T typedef long size_t; but printf returns with 0 (error condition?) If anybody can help a novice at C with what is probably an easy problem, I would appreciate it very much. Thanks - Marek Zielinski & Al Hambidge Brought to you by Super Global Mega Corp .com