-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.c
77 lines (46 loc) · 2.38 KB
/
test.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* test.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gusgonza <gusgonza@student.42barcel> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/07 20:15:14 by gusgonza #+# #+# */
/* Updated: 2024/04/11 17:38:47 by gusgonza ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include "ft_printf.h"
int main() {
printf("==== Results with original printf ====\n\n");
printf("[Printf] String: Hello, world!\n");
printf("[Printf] Character: %c\n", 'A');
printf("[Printf] String: %s\n", "Example");
printf("[Printf] Integer: %d\n", 42);
printf("[Printf] MAX Integer: %d\n", 2147483647);
printf("[Printf] MIN Integer: %ld\n", -2147483648);
printf("[Printf] Unsigned Integer: %u\n", -12345);
printf("[Printf] Unsigned Integer: %u\n", 2147483647);
printf("[Printf] Hexadecimal (lowercase): %x\n", 255);
printf("[Printf] Hexadecimal (uppercase): %X\n", 255);
int *ptr;
int a = 12;
ptr = &a;
printf("[Printf] Pointer: %p\n GG", (void *)ptr);
printf("[Printf] Literal percentage character: %%\n");
printf("\n\n");
printf("==== Results with your ft_printf function ====\n\n");
ft_printf("[Ft_printf] String: Hello, world!\n");
ft_printf("[Ft_printf] Character: %c\n", 'A');
ft_printf("[Ft_printf] String: %s\n", "Example");
ft_printf("[Ft_printf] Integer: %d\n", 42);
ft_printf("[Ft_printf] MAX Integer: %d\n", 2147483647);
ft_printf("[Ft_printf] MIN Integer: %d\n", -2147483648);
ft_printf("[Ft_printf] Unsigned Integer: %u\n", -12345);
ft_printf("[Ft_printf] Unsigned Integer: %u\n", 2147483647);
ft_printf("[Ft_printf] Hexadecimal (lowercase): %x\n", 255);
ft_printf("[Ft_printf] Hexadecimal (uppercase): %X\n", 255);
ft_printf("[Ft_printf] Pointer: %p gg\n ", (void *)ptr);
ft_printf("[Ft_printf] Literal percentage character: %%\n");
return 0;
}