File tree 3 files changed +37
-0
lines changed
0x05-pointers_arrays_strings
3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include "main.h"
2
+
3
+ /**
4
+ * main - check the code
5
+ *
6
+ * Return: Always 0.
7
+ */
8
+ int main (void )
9
+ {
10
+ char * str ;
11
+
12
+ str = "I do not fear computers. I fear the lack of them - Isaac Asimov" ;
13
+ _puts (str );
14
+ return (0 );
15
+ }
Original file line number Diff line number Diff line change
1
+ #include "main.h"
2
+
3
+ /**
4
+ * _puts - print string to stdout.
5
+ *
6
+ * @str: string to be printed.
7
+ *
8
+ * Return: Nothing.
9
+ */
10
+ void _puts (char * str )
11
+ {
12
+ char * ptr ;
13
+
14
+ ptr = str ;
15
+ while (* ptr != '\0' )
16
+ {
17
+ _putchar (* ptr );
18
+ ptr = ptr + 1 ;
19
+ }
20
+ _putchar ('\n' );
21
+ }
Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ int _putchar(char);
2
2
void reset_to_98 (int * );
3
3
void swap_int (int * , int * );
4
4
int _strlen (char * );
5
+ void _puts (char * );
You can’t perform that action at this time.
0 commit comments