This repository is dedicated to practicing and studying character and string manipulation in the C programming language, covering everything from basic fundamentals to advanced library usage.
Study of functions for verifying and converting individual characters:
- Verification:
isdigit(),isalpha(),isalnum(),islower(),isupper(),ispunct(), andisspace(). - Conversion:
tolower()andtoupper().
- Definition: Strings in C are sequences of characters terminated by the null character
\0. - Safe Input/Output: Using
fgets()for safe reading (avoiding buffer overflow) andputs()orprintf()for display. - Character Access: Iterating through strings using the idiomatic
for (int i = 0; str[i] != '\0'; i++)pattern.
strlen(): Returns the string length.strcpy()/strncpy(): Copying strings.strcat()/strncat(): Concatenation.strcmp()/strncmp()/stricmp(): String comparison.- Advanced Search & Utility:
strchr(),strrchr(),strstr(),strrev(), andstrset().
atoi(): String toint.atof(): String tofloat/double.itoa(): Integer to string.
- Memory Safety: Always reserving space for the null terminator (N+1).
- Secure I/O: Preferring
fgets()overgets()(which is deprecated and unsafe). - Performance: Calculating
strlen()once before long loops to avoid redundant processing.