Category Archives: String

Another Good Example of Struct using Function and Pointer



Using function with Struct user defined type also pointer


why we used *sp in one place and sp in another place ?there s a reason behind this
*sp means address is passing where after the local input takeup it will go but if not use  dereferencing then it will not go outside. So to write we need with address.

and in sp it is read only. so to print sp is enough to show.


Array of String

theortecical concept source:


source: 101cproblems:

Problem 80: Array of String

Take an array of string named fruitNames and store four fruit names (“Mango”, “Jack-fruit”, “Banana”, “Litchi”). Now iterate the array using loop and print the names of the fruits each in a separate line.



Char Pointer Practical Example Using String Input and String/Char Variable Passing





Lowercase to Uppercase with array


Another approach:

Another Approach I found on my head:


Extract Digits From a Number and Make a Sum of all the digits and show this in C

Code is here:


Modular Beautiful Code: 😀

Actually array return function is not directly possible in C and I am finding the solution here.

Took Slightly Help From this link:

strcmp() explained perfectly



Another Approach To Find the Length Of String



String Secret Revealed in C

String Input Take Without any gets function just scanf is enough for taking any input withlout gets function

another example:




String Frequency Count

simple code:

good output:

Reference: solution:



String Palindrome Problem

My Own Logic:

Another logic:


another good logic:



Count word

Problem from
Write a program which will take a sentence as input and tell us how many words are there. [If user gives input “I love Bangladesh”, then the output should be: 3]



String Problem: Uppercase to Lowercase, Lowercase to Uppercase

Problem 70: Case Fix

You are given a string mixed with uppercase and lowercase letters . Your task is to write a program which will
flip the letters : (UpperCase -> LowerCase, LowerCase -> UpperCase)


eLepHanT   Elephant

cAt                  Cat

SuNDAY       Sunday


not upto the output yet:

beautiful code with exacts output:



String Problem: ASCII table related

Problem: Write a program which takes a string of alphabet as input and replace all the characters with the 3rd immediate character of it. All the alphabets of the input string will be small letter. [If user gives input “abc” you should print “def”, if user gives input “xyz” you should print “abc”]



Concatanated String Problems

Problem: Take three different string as input from the user(“We”, “ Love” and “ Bangladesh”). Now concate these three string and print it (“We Love Bangladesh”). [There is a leading space in “ Love” and “ Bangladesh”]


Another approach: