Help on Segmentation Fault!!!
i am new user of linux programming!!
i need ur help!!
the output is:
void *mymalloc(size_t request);
char * test;
int i = 0;
test = (char *)mymalloc(sizeof(char) * 6);
if (test == NULL)
test[i] = 'a';
printf("%d bytes written to memory\n", i+1);
void * mymalloc(size_t request)
2565 bytes written to memory
2566 bytes written to memory
2567 bytes written to memory
2568 bytes written to memory
my question is wat is going on this code???can anyone explain to me ??? y izzit segmentation fault after 2568 bytes ???
another question is wat should i do if i want to improve the mymalloc() function?