-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path2-main.c
41 lines (39 loc) · 766 Bytes
/
2-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
#include "main.h"
#include <stdio.h>
/**
* main - check the code
*
* Return: Always 0.
*/
int main(void)
{
char s1[98];
char *ptr;
int i;
for (i = 0; i < 98 - 1; i++)
{
s1[i] = '*';
}
s1[i] = '\0';
printf("%s\n", s1);
ptr = _strncpy(s1, "First, solve the problem. Then, write the code\n", 5);
printf("%s\n", s1);
printf("%s\n", ptr);
ptr = _strncpy(s1, "First, solve the problem. Then, write the code\n", 90);
printf("%s", s1);
printf("%s", ptr);
for (i = 0; i < 98; i++)
{
if (i % 10)
{
printf(" ");
}
if (!(i % 10) && i)
{
printf("\n");
}
printf("0x%02x", s1[i]);
}
printf("\n");
return (0);
}