Afficher un message
Vieux 21/10/2007, 00h49   #7
Marcin Kalicinski
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Allocationg memory: contigously ?

> if I allocate memory in a simple program like
>
> int* pint1=new[1000];
> int* pint2=new[1000];
> int* pint3=new[1000];
>
> then memory is allocated on the heap. My question is if this three
> "memory fragmetns" are allocated contigously. And if not, what could I
> do to allocate them contigously.


int *bigfatpint = new int[3000];
int *pint1 = bigfatpint;
int *pint2 = bigfatpint + 1000;
int *pint3 = bigfatpint + 2000;

cheers,
Marcin


  Réponse avec citation
 
Page generated in 0,04150 seconds with 9 queries