-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalyze_first_row.c
50 lines (42 loc) · 1.33 KB
/
analyze_first_row.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
42
43
44
45
46
47
48
/* ************************************************************************** */
/* */
/* :::::::: */
/* functions.c :+: :+: */
/* +:+ */
/* By: jramdara <[email protected]> +#+ */
/* +#+ */
/* Created: 2019/08/24 16:49:20 by jramdara #+# #+# */
/* Updated: 2019/08/25 11:25:15 by jramdara ######## odam.nl */
/* */
/* ************************************************************************** */
#include "header.h"
char first_char_first_row(char *str)
{
return (str[0]);
}
char middle_char_first_row(char *str, int x)
{
char search;
int i;
i = 1;
x--;
search = str[1];
while (x - 2 > 0)
{
if(str[i] != search)
return ('x');
i++;
x--;
}
return (str[1]);
}
char last_char_first_row(char *str)
{
int i;
i = 0;
while (str[i] != '\n')
{
i++;
}
return (str[i - 1]);
}