-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprint_str.c
More file actions
44 lines (38 loc) · 712 Bytes
/
print_str.c
File metadata and controls
44 lines (38 loc) · 712 Bytes
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
#include "holberton.h"
/**
* print_char - prints a character
* @value: list of va_args
*
* Return: 1
*/
int print_char(va_list value)
{
int i = va_arg(value, int);
return (_print(i));
}
/**
* print_string - prints an array of characters
* @value: list of va_args
*
* Return: amount of bytes printed to the output
*/
int print_string(va_list value)
{
char *data = va_arg(value, char *);
int i;
if (data == NULL)
data = "(null)";
for (i = 0; data[i] != '\0'; i++)
_print(data[i]);
return (0);
}
/**
* print_percentage - prints a literal '%' character
* @value: list of va_args
*
* Return: 1
*/
int print_percentage(va_list value __attribute__ ((unused)))
{
return (_print('%'));
}