-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
79 lines (75 loc) · 2.59 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: atbicer <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/06 13:14:30 by atbicer #+# #+# */
/* Updated: 2024/06/26 13:33:42 by atbicer ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
int ft_printf(const char *format, ...);
int main(void)
{
int count;
int test;
test = INT32_MIN;
// ft_printf("Hello %s, today is %d, in hex %x, char->%c\n");
// printf("Hello %s, today is %d, in hex %x, char->%c\n");
// ft_printf("test\n");
count = ft_printf("Hello %s\n", "John");
ft_printf("count(%d)\n", count);
count = ft_printf("[%d]\n", test);
ft_printf("The chars written are [%d]\n", count);
ft_printf("hex: [%X]\n", 100023);
ft_printf("%%\n");
// Address
count = ft_printf("Addr: [%p]\n", (void *)-14523);
ft_printf("Addr: count(%d)\n", count);
// Unsigned int
ft_printf("\nUINT tests: \n");
ft_printf("[%u]\n", 0);
ft_printf("[%u]\n", -10);
ft_printf("[%u]\n", -200000);
ft_printf("[%u]\n", -6000023);
ft_printf("[%u]\n", 10000);
ft_printf("[%u]\n", 100023);
ft_printf("[%u]\n", INT_MAX);
ft_printf("[%u]\n", INT_MIN);
ft_printf("[%u]\n", UINT_MAX);
ft_printf("dgs%uxx\n", 10);
ft_printf("%u%uu%u\n", 1, 2, -3);
//
printf("\n\n[Real below]\n\n"); // real
//
count = printf("Hello %s\n", "John");
printf("count(%d)\n", count);
count = printf("[%d]\n", test);
printf("The chars written are [%d]\n", count);
printf("hex: [%X]\n", 100023);
printf("%%\n");
// Address
count = printf("Addr: [%p]\n", (void *)-14523); // p
printf("Addr: count(%d)\n", count);
// Unsigned int
printf("\nUINT tests: \n");
printf("[%u]\n", 0);
printf("[%u]\n", -10);
printf("[%u]\n", -200000);
printf("[%u]\n", -6000023);
printf("[%u]\n", 10000);
printf("[%u]\n", 100023);
printf("[%u]\n", INT_MAX);
printf("[%u]\n", INT_MIN);
printf("[%u]\n", UINT_MAX);
printf("dgs%uxx\n", 10);
printf("%u%uu%u\n", 1, 2, -3);
//
// LIBFT test
return (0);
}