Basic question about malloc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
     I'm looking for that whether the object allocated by malloc is the multiple of certain bytes!
     Or how does the malloc allocate dynamic memory ?? 
     I does an experiment in my computer!
#include<stdio.h>
#include<stdlib.h>

#define NUM 33
int main(int argc,const char *argv[])
{
char *a, *b, *c;
a = malloc(NUM);
b = malloc(NUM);
c = malloc(NUM);

printf("a = %x\n",a);
printf("b = %x\n",b);
printf("c = %x\n",c);
free(a);
free(b);
free(c);
return 0;
}

But the result has no feature about a ,b ,c!
Can someone tell me what's wrong with me?
My GCC version is gcc (Debian 4.9.2-10) 4.9.2
mudongliang

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux