-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.c
45 lines (43 loc) · 1.32 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
#include <limits.h>
#include <stdio.h>
#include "main.h"
/**
* main - Entry point
*
* Return: Always 0
*/
int main(void)
{
int len;
int len2;
unsigned int ui;
/*void *addr;*/
len = _printf("Let's try to printf a simple sentence.\n");
len2 = printf("Let's try to printf a simple sentence.\n");
ui = (unsigned int)INT_MAX + 1024;
/*addr = (void *)0x7ffe637541f0;*/
_printf("Length:[%d, %i]\n", INT_MIN, len);
printf("Length:[%d, %i]\n", INT_MIN, len2);
_printf("Negative:[%d]\n", -762534);
printf("Negative:[%d]\n", -762534);
_printf("Unsigned:[%u]\n", ui);
printf("Unsigned:[%u]\n", ui);
_printf("Unsigned octal:[%o]\n", ui);
printf("Unsigned octal:[%o]\n", ui);
_printf("Unsigned hexadecimal:[%x, %X]\n", ui, ui);
printf("Unsigned hexadecimal:[%x, %X]\n", ui, ui);
_printf("Character:[%c]\n",64);
printf("Character:[%c]\n", 64);
_printf("String:[%s]\n", "This is a string");
printf("String:[%s]\n", "This is a string");
/*_printf("Address:[%p]\n", addr);
printf("Address:[%p]\n", addr);*/
len = _printf("Percent:[%%]\n");
len2 = printf("Percent:[%%]\n");
_printf("Len:[%d]\n", len);
printf("Len:[%d]\n", len2);
_printf("ROT13:[%R]\n", "This is a string");
printf("Unknown:[%r]\n");
_printf("%s\n", 0);
return (0);
}