-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
65 lines (60 loc) · 2.47 KB
/
main.c
File metadata and controls
65 lines (60 loc) · 2.47 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vzhao <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/07/03 13:07:43 by vzhao #+# #+# */
/* Updated: 2019/07/29 18:17:17 by vzhao ### ########.fr */
/* */
/* ************************************************************************** */
#include "srcs/ft_printf.h"
#include <stdio.h>
#include <limits.h>
#include <math.h>
int main(void)
{
/* char C = 'C';
// %c test: Use....
// Valid: %c, %-c, %-5c, %5c, %lc, %-lc, %-5lc, %5lc
// InValid: everything else should fail......
printf("......printf printed: %d\n", printf("%c", C));
printf("...ft_printf printed: %d\n", ft_printf("%c", C));
printf("......printf printed: %d\n", printf("%-c", C));
printf("...ft_printf printed: %d\n", ft_printf("%-c", C));
printf("......printf printed: %d\n", printf("%5c", C));
printf("...ft_printf printed: %d\n", ft_printf("%5c", C));
printf("......printf printed: %d\n", printf("%-5c", C));
printf("...ft_printf printed: %d\n", ft_printf("%-5c", C));
printf("......printf printed: %d\n", printf("%lc", C));
printf("...ft_printf printed: %d\n", ft_printf("%lc", C));
printf("......printf printed: %d\n", printf("%5lc", C));
printf("...ft_printf printed: %d\n", ft_printf("%5lc", C));
printf("......printf printed: %d\n", printf("%-5lc", C));
printf("...ft_printf printed: %d\n", ft_printf("%-5lc", C));
*/
/*
* Color codes......
* Escape sequence to initiate color code = \033
[0;31m Red
[1;31m Bold Red
[0;32m Green
[1;32m Bold Green
[0;33m Yellow
[01;33m Bold Yellow
[0;34m Blue
[1;34m Bold Blue
[0;35m Magenta
[1;35m Bold Magenta
[0;36m Cyan
[1;36m Bold Cyan
[0m Reset
*/
// char *test = NULL;
printf("---char printed: %d\n", printf("\033[1;32m%s\033[0m", "Hello"));
printf("---char printed: %d\n", ft_printf("\033[1;32m%s\033[0m", "Hello"));
// ft_putstr("\033[0;31m Is this red \033[0m\n");
// system("leaks test_ftprintf");
return (0);
}