Created
April 20, 2018 09:30
-
-
Save ayaderaghul/2390d965700decffa14cc3aab24ee6e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
void *ft_memalloc(size_t size) | |
{ | |
char *tab; | |
size_t i; | |
tab = (char *)malloc(sizeof(char) * (size + 1)); | |
if (tab == NULL) | |
return (tab); | |
i = 0; | |
while (i < size) | |
tab[i++] = 0; | |
tab[i] = 0; | |
return (tab); | |
} |
pgiammel
commented
Apr 20, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment