Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- char* tulloc(size_t size)
- {
- int bytes_to_alloc = size*(sizeof("tull"));
- char* p = malloc(bytes_to_alloc);
- int i=0;
- for(i;i<bytes_to_alloc;i+=4){
- p[i] = "tull";
- }
- p[bytes_to_alloc] = '\0';
- return p;
- }
- int main()
- {
- char *tull = tulloc(10);
- printf("%s\n",tull);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement