Пример #1
0
int main(int argc, char *argv[])
{
		int a = 6;
		printf("%d\n", a);
		int *ptr1;
		int **ptr2;
		int ***ptr3;
		int ****ptr4;
		int *****ptr5;
		int ******ptr6;
		int *******ptr7;
		int ********ptr8;
		int *********ptr9;
		
		ptr1 = &a;
		ptr2 = &ptr1;
		ptr3 = &ptr2;
		ptr4 = &ptr3;
		ptr5 = &ptr4;
		ptr6 = &ptr5;
		ptr7 = &ptr6;
		ptr8 = &ptr7;
		ptr9 = &ptr8;
	
	ft_ultimate_ft(ptr9);
	printf("%d\n", a);
}
Пример #2
0
int 	main(void)
{
	int a;
	int *ptr1;
	int **ptr2;
	int ***ptr3;
	int ****ptr4;
	int *****ptr5;
	int ******ptr6;
	int *******ptr7;
	int ********ptr8;
	int *********ptr9;

	a = 10;
	ptr1 = &a;
	ptr2 = &ptr1;
	ptr3 = &ptr2;
	ptr4 = &ptr3;
	ptr5 = &ptr4;
	ptr6 = &ptr5;
	ptr7 = &ptr6;
	ptr8 = &ptr7;
	ptr9 = &ptr8;

	printf("avant = %d\n", a);
	ft_ultimate_ft(ptr9);
	printf("après = %d\n", a);
	return (0);
}
Пример #3
0
int		main(void)
{
	int		nombre;
	int		*ptr1;
	int		**ptr2;
	int		***ptr3;
	int		****ptr4;
	int		*****ptr5;
	int		******ptr6;
	int		*******ptr7;
	int		********ptr8;
	int		*********ptr9;
	
	nombre = 22;
	ptr1 = &nombre;
	ptr2 = ptr1;
	ptr3 = ptr2;
	ptr4 = ptr3;
	ptr5 = ptr4;
	ptr6 = ptr5;
	ptr7 = ptr6;
	ptr8 = ptr7;
	ptr9 = ptr8;
	ft_ultimate_ft(ptr9);
	printf("nombre : %p\n", &ptr9);
	printf("nombre : %d\n");
	return (0);
}
Пример #4
0
int	main(void)
{
	int un = 1;
	int *********nbr;
	int a = 14, b = 3, div = 0, mod = 0;
	ft_ft(&un);
	ft_ultimate_ft(nbr);
	ft_div_mod(a, b, &div, &mod);
	return (0);
}
Пример #5
0
void	test(int n)
{
	g_ptr1 = &n;
	g_ptr2 = &g_ptr1;
	g_ptr3 = &g_ptr2;
	g_ptr4 = &g_ptr3;
	g_ptr5 = &g_ptr4;
	g_ptr6 = &g_ptr5;
	g_ptr7 = &g_ptr6;
	g_ptr8 = &g_ptr7;
	g_ptr9 = &g_ptr8;
	printf("n = %i\n\nft_ultimate_ft(g_ptr9)\n", n);
	ft_ultimate_ft(g_ptr9);
	printf("\nn = %i\n", n);
}
Пример #6
0
int	main(void)
{
	int a;
	int *ptr;

	printf("EXERCICE 00 ");
	printf("\n");
	printf("Doit afficher \"42\"");
	printf("\n");
	a = 1337;
	ptr = &a;
	ft_ft(ptr);
	ft_putnbr(a);
	printf("\n");
	printf("\n");
	
	printf("EXERCICE 01");
	printf("\n");
	printf("Doit afficher \"42\"");
	printf("\n");
	int **ptr2;
	int ***ptr3;
	int ****ptr4;
	int *****ptr5;
	int ******ptr6;
	int *******ptr7;
	int ********ptr8;
	int *********ptr9;
	a = 1337;
	ptr2 = &ptr;
	ptr3 = &ptr2;
	ptr4 = &ptr3;
	ptr5 = &ptr4;
	ptr6 = &ptr5;
	ptr7 = &ptr6;
	ptr8 = &ptr7;
	ptr9 = &ptr8;
	ft_ultimate_ft(ptr9);
	ft_putnbr(a);
	printf("\n");
	printf("\n");
	
	printf("EXERCICE 02");
	printf("\n");
	printf("Doit afficher \"666\" puis \"1337\"");
	printf("\n");
	int b;
	int *ptr_b;
	a = 1337;
	b = 666;
	ptr_b = &b;
	ft_swap(ptr, ptr_b);
	ft_putnbr(a);
	printf("\n");
	ft_putnbr(b);
	printf("\n");
	printf("\n");
	
	printf("EXERCICE 03");
	printf("\n");
	printf("Doit afficher \"4\" puis \"2\"");
	printf("\n");
	int div_value;
	int mod_value;
	int *div;
	int *mod;
	div = &div_value;
	mod = &mod_value;
	a = 42;
	b = 10;
	ft_div_mod(a, b, div, mod);
	ft_putnbr(*div);
	printf("\n");
	ft_putnbr(*mod);
	printf("\n");
	printf("\n");
	
	printf("EXERCICE 04");
	printf("\n");
	printf("Doit afficher \"4\" puis \"2\"");
	printf("\n");
	a = 42;
	b = 10;
	ft_ultimate_div_mod(ptr, ptr_b);
	ft_putnbr(a);
	printf("\n");
	ft_putnbr(b);
	printf("\n");
	printf("\n");
	
	printf("EXERCICE 05");
	printf("\n");
	printf("Doit afficher \"LOL\"");
	printf("\n");
	char *str;
	str = "LOL";
	ft_putstr(str);
	printf("\n");	
	printf("\n");

	printf("EXERCICE 06");
	printf("\n");
	printf("Doit afficher \"42\"");
	printf("\n");
	char *str_exo06;
	str_exo06 = "000000000000000000000000000000000000000042";
	ft_putnbr(ft_strlen(str_exo06));
	printf("\n");
	printf("\n");

}