// Function To allocate bytes .
// Test function for writing write operation.
#include<stdio.h>
#include<stdlib.h>
#define SIZE 1000
char arr[SIZE];
char *p=arr;
char * allocate(unsigned char );
char * allocate(unsigned char j)
{
if(arr+SIZE-p>j)
{
p=p+j;
return p-j;
}
else
{
printf(“Error in size\n”);
return NULL;
}
}
int main()
{
int *j;
char *l;
j=(int *)allocate(sizeof(int));
if(!j)
printf(“Error\n”);
*j=67;
l=(char *)allocate(sizeof(char));
*l=77;
printf(“%d %d\n”,*j,sizeof(*l));
return 0;
}