Subj : Re: Questions about large memory allocation...? To : borland.public.cpp.borlandcpp From : waking Date : Wed Sep 14 2005 12:51 am On Tue, 13 Sep 2005 23:27:14 +0500, "mujeebrm" wrote: > how can i allocate more than 70000 and show it printed 0 to 69999 Use huge pointers. > unsigned int *p=0,n=0; unsigned int huge *p=0,n=0; > p = (unsigned int *) malloc(65535*sizeof(unsigned int ) ); >/* this works */ Not the way you think. 65535*2 = 131070 which gets truncated to fit into an unsigned int, so you're only allocating 31070 bytes. Use farmalloc to avoid this truncation: p = (unsigned int huge *) farmalloc(65535*sizeof(unsigned int ) ); -- Wayne A. King (waking@idirect.com, Wayne_A_King@compuserve.com) .