We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b528f04 commit ef7103eCopy full SHA for ef7103e
0x05-pointers_arrays_strings/6-main.c
@@ -0,0 +1,15 @@
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 = "0123456789";
13
+ puts2(str);
14
+ return (0);
15
+}
0x05-pointers_arrays_strings/6-puts2.c
@@ -0,0 +1,21 @@
+ * puts2 - func that prints 1 char/2 of a string, followed by a new line.
+ * @str: declaration of str and paramters for the function puts2
+void puts2(char *str)
+ int c;
+ char l;
+ for (c = 0; str[c] != 0; c++)
+ {
+ if (c % 2 == 0)
16
+ l = str[c];
17
+ _putchar(l);
18
+ }
19
20
+ _putchar('\n');
21
0 commit comments