Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <unistd.h>
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- void function(int ****range)
- {
- *range = malloc(sizeof(***range));
- ***range = malloc(sizeof(int) * 5);
- printf("%p\n",*range);
- int i = 0 ;
- while(i < 5)
- {
- i++ ;
- }
- i = 0 ;
- while(i < 5)
- {
- *(***range + i) = 12 ;
- i++ ;
- }
- }
- int main(void)
- {
- int ***tab = NULL ;
- function(&tab);
- printf("%p",tab);
- printf("%d\n", *(**tab));
- printf("%d\n", *(**tab + 1));
- printf("%d\n", *(**tab + 2));
- printf("%d\n", *(**tab + 3));
- printf("%d\n", *(**tab + 4));
- printf("%d\n", *(**tab + 5));
- free(tab);
- tab = NULL ;
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement