allocating a specific number of bytes in memory : <p>I have been trying to allocate a memory pool of a specified number of bytes in memory. when I proceeded to test the program, it would only allocate a single byte at a time  for each memory pool.</p>

<pre><code>   typedef struct _POOL
{
    int size;
    void* memory;

} Pool;

Pool* allocatePool(int x);
void freePool(Pool* pool);
void store(Pool* pool, int offset, int size, void *object);

int main()
{

    printf("enter the number of bytes you want to allocate//&gt;\n");
    int x;
    int y;
    Pool* p;
    scanf("%d", &amp;x);
    printf("enter the number of bytes you want to allocate//&gt;\n");
    scanf("%d", &amp;x);
    p=allocatePool(x,y);
    return 0;

}



Pool* allocatePool(int x,int y)
{
    static Pool p;
    static Pool p2;
    p.size = x;
    p2.size=y;
    p.memory = malloc(x);
    p2.memory = malloc(y);
    printf("%p\n", &amp;p);
    printf("%p\n", &amp;p2);
    return &amp;p;//return the adress of the Pool


}
</code></pre>
