repl.it
@parzibyte/

C to lower

C

No description

fork
loading
Files
  • main.c
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
	Convert C string to lowercase

	@author parzibyte
*/
#include <stdio.h>
#include <ctype.h>

int main(int argc, char const *argv[])
{
	char my_string[] = "Hello world! this is a simple string. parzibyte.me";
	printf("Original string: %s\n", my_string);

	// Convert each char
	// using tolower
	for (int index = 0; my_string[index] != '\0'; ++index){
		my_string[index] = tolower(my_string[index]);
	}
	printf("After convert: %s\n", my_string);
	return 0;
}
Fetching token
?