aboutsummaryrefslogtreecommitdiff
path: root/tst/upper.c
blob: 1d2d71fc009450456cd6c84368d952782c0e133c (plain) (blame)
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
#include <stdio.h>
#include <stdlib.h>

#include <string.h>

void	string_upper(char* str)
{
	unsigned int	len, i;

	len = strlen (str);

	for (i = 0 ; i < len ; i++)
	{
		if (str[i] >= 0x61 && str[i] <= 0x7A)
				str[i] -= 0x20;
	}
}

int main()
{
	char in[] = "abcdefghijklmnopqrstuvwxyz  ABCDEFGHIJKLMNOPQRSTUVWXYZ}}{''é""";

	string_upper (in);

	printf ("%s\n", in);

	return 0;
}