Login Register Appointment

String Handling

Lesson 14/27 | Study Time: 60 Min

What You Will Learn in This Live Session

1️⃣ Introduction to Strings

✔ What is a string in C?
✔ Declaring and initializing strings (char str[] vs char *str)
✔ How strings are stored in memory (null-terminated character arrays)

2️⃣ Input and Output of Strings

✔ Using scanf() and printf() (limitations of scanf())
✔ Using gets() and puts() (handling spaces in input)
✔ Safe input handling with fgets()

3️⃣ String Functions from <string.h>

✔ strlen() – Find the length of a string
✔ strcpy() – Copy one string to another
✔ strncpy() – Copy a fixed number of characters
✔ strcat() – Concatenate two strings
✔ strncat() – Concatenate with length restriction
✔ strcmp() – Compare two strings (lexicographically)
✔ stricmp() – Case-insensitive string comparison
✔ strrev() – Reverse a string
✔ strlwr() and strupr() – Convert to lowercase and uppercase

4️⃣ Manual String Operations (Without Using <string.h>)

✔ Find the length of a string manually
✔ Implement string copy and concatenation without built-in functions
✔ Compare two strings manually