-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
138 lines (97 loc) · 3.2 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ccastill <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/05/21 19:48:56 by carlos #+# #+# */
/* Updated: 2020/07/18 19:38:41 by ccastill ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_printf(const char *s, ...);
int main ()
{
int f, g;
unsigned long int a = 4509102520;
/*
ft_printf("%05u\n", 43);
printf("%05u\n", 43);
//printf("%d\n", f);
//printf("%d\n", g);
ft_printf ("%15.7d\n", 3267);
printf ("%15.7d\n", 3267);
ft_printf ("%10.5d\n", 216);
printf ("%10.5d\n", 216);
ft_printf ("%.6d\n", -3);
printf ("%.6d\n", -3);
ft_printf ("%8.3d\n", -8473);
printf ("%8.3d\n", -8473);
ft_printf ("%10.5d\n", -216);
printf ("%10.5d\n", -216);
ft_printf ("%-10.5d casa\n", -216);
printf ("%-10.5d casa\n", -216);
ft_printf ("%0-8.3d casa\n", -8473);
printf ("%0-8.3d casa\n", -8473);
ft_printf ("%05d\n",43);
printf ("%05d\n",43);
ft_printf ("%03d\n", 634);
printf ("%03d\n", 634);
ft_printf ("%04d\n", -4825);
printf ("%04d\n", -4825);
ft_printf ("%03.7d\n", -2375);
printf ("%03.7d\n", -2375);
ft_printf ("%.d\n", 0);
printf ("%.d\n", 0);
char *s;
char *memory;
int a=0; //Declaración de variable entera de tipo entero
int *puntero; //Declaración de variable puntero de tipo entero
puntero = &a; //Asignación de la dirección memoria de a
int z = -5841474;
ft_printf("El número int es %d y el %u\n", z, z);
printf("El número int es %d y el %u\n", z, z);
ft_printf("%.d\n", 0);
printf("%.d\n", 0);
ft_printf("this %i number\n", 0);
printf("this %i number", 0);
ft_printf("%-3d\n", 0);
printf("%-3d\n", 0);
*/
/*
f = ft_printf("%.p\n", NULL);
g = printf("%.p\n", NULL);
printf("%d\n", f);
printf("%d\n", g);
*/
f = ft_printf("%.p\n", NULL);
g = printf("%.p\n", NULL);
printf("%d\n", f);
printf("%d\n", g);
f = ft_printf("%.5p\n", 0);
g = printf("%.5p\n", 0);
printf("%d\n", f);
printf("%d\n", g);
f = ft_printf("%.0p\n", 0);
g = printf("%.0p\n", 0);
printf("%d\n", f);
printf("%d\n", g);
/*
f = ft_printf("%.5p\n", 0);
g = printf("%.5p\n", 0);
printf("%d\n", f);
printf("%d\n", g);
f = ft_printf("%.0p", 0);
g = printf("%.0p", 0);
printf("%d\n", f);
printf("%d\n", g);
*/
/*
f = ft_printf("%-*.*s", 7, 3, "yolo");
g = printf("%-*.*s", 7, 3, "yolo");
printf("%d\n", f);
printf("%d\n", g);
*/
return(0);
}