Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
JennyHadir committed Oct 30, 2020
1 parent 56ac7fa commit 7130b7e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions _printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ int (*printer(char formati))(va_list)
{'b', print_b},
{'r', print_r},
{'S', print_S},
{'p', print_p},
{'\0', NULL}
};
int i = 0;
Expand Down
1 change: 1 addition & 0 deletions holberton.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ int print_rot13(va_list arg);
int print_b(va_list arg);
int print_r(va_list arg);
int print_S(va_list arg);
int print_p(va_list arg);
#endif
19 changes: 19 additions & 0 deletions print_p.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "holberton.h"
#include <stdlib.h>

/**
* print_p - Print an adress.
* @arg: String address.
* Return: integer.
*/
int print_p(va_list arg)
{
char *str = va_arg(arg, char *);
int i = 0;

if (str == NULL)
str = "(null)";
for (; str[i]; i++)
_putchar(str[i]);
return (i);
}

0 comments on commit 7130b7e

Please sign in to comment.