Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ucbvax!hplabs!hpda!hpcupt1!hprnd!pyt From: pyt@hprnd.HP.COM (Pierre-Yves Thoulon) Newsgroups: comp.lang.c Subject: Re: Allocating Huge Arrays in MSC 5.0 Message-ID: <2310004@hprnd.HP.COM> Date: 6 Jan 89 04:48:13 GMT References: <1565@virginia.acc.virginia.edu> Organization: HP Roseville Networks Division Lines: 23 I guess the problem is with your pointer arithmetic. I don't think the compiler likes (vector + i) when i is such that the resulting pointer would cross the 64K boundary. I'd rather use the following: double huge *vector, huge *index; int i, number_of_elements, retval; ... vector = (double *) malloc( number_of_elements * sizeof( double ) ); index = vector; /* to save the base pointer value */ for( i = 0; i < number_of_elements; i++ ) { retval = fscanf(infp,"%lf",index++ ); ^^^^^^^ } I've had the same kind of problem recently, I was using a vector[i] notation for a huge vector. It worked fine until I went beyond the first 64K limit. Incrementing a pointer as above solved the problem. (took me a while to figure out... !) Hope this helps. Pyt.