Quantcast
Channel: Maximum memory which malloc can allocate - Stack Overflow
Viewing all articles
Browse latest Browse all 11

Answer by human.js for maximum memory which malloc can allocate

$
0
0

Try this

#include <stdlib.h>
#include <stdio.h>

main() {
    int Mb = 0;
    while (malloc(1<<20)) ++Mb;
    printf("Allocated %d Mb total\n", Mb);
}

Include stdlib and stdio for it.
This extract is taken from deep c secrets.


Viewing all articles
Browse latest Browse all 11

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>