I want to allocate 'n' bytes of memory. How can i do that. I have to get this n value from another variable. If i give n=3, it has to allocate 3 bytes of memory. How can i do this. I tried with the following code. But its not allocating exact bytes.
Can anyone help meCode:int n; int *m; printf("enter n value:"); scanf("%d",&n); m=(int *)malloc(n);
Thanks in advance