Code Snippets C

#include
#include
int main(void)
{
char *p;
long j;
j = 0;
do {
p = malloc(1000);
if(p)
j += 1000;
} while(p);
printf("Approximately %ld bytes of free memory.", j);
return 0;
}