Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void ft_indirection1(int *ptr)
- {
- *ptr = 42;
- }
- void ft_indirection2(int **ptr)
- {
- **ptr = 21;
- }
- int ft_test1(void)
- {
- int i;
- i = 0;
- printf("%d <- should be 0\n");
- ft_indirection1(PARAMETER_HERE) // give good parameter here without changing anything
- printf("%d <- should be 42\n");
- return (1);
- }
- /*
- int ft_test2(void)
- {
- int i;
- int *bla;
- int **bla2;
- i = 0;
- bla = &i;
- bla2 = &bla;
- printf("%d <- should be 0\n");
- ft_indirection1(PARARMETER_HERE) // make it work by using only >>BLA2<< THERE !
- printf("%d <- should be 42\n");
- bla = 0;
- ft_indirection1(PARAMETER_HERE) // make it work by using only >>I<< there
- printf("%d <- should be 42\n");
- bla = 0;
- ft_indirection2(PARAMETER_HERE) // make it work by using only >>BLA<< there
- printf("%d <- should be 42\n");
- return (1);
- }
- */
- int main(void)
- {
- ft_test1();
- // ft_test2();
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement