Tag Archives: string

Some string functions

puts()

in c i will implement.
Main job of this function is to print a new line autoamtically where printf() does not give this.

example:

putchar()

The actual work of putchar is it display string as character by character putchar is a macro that outputs character on stdout.

and the basic is : putchar(‘a’)    // it will print a
and putchar(a);     //it will print the value in stored in a
And the basic parameters of this is:
int putchar(int c);

Take input in string:

In string we don’t mention ampersand & sign as string automatically take it as address.

catcpy.c

String equality:

String Lower:

String Upper:

strdup.c

strstr.c

 

 

Reference for some examples:
http://fresh2refresh.com/c-programming/c-strings/

http://www.apiexamples.com/c/string/strstr.html

Length of a input string

Another method:

With while loop:

 

 

 

Uppercase to Lowercase

Lowercase to Uppercase

Uppercase to Lowercase

another method:

 

 

 

String Processing

নিজের কন্সেপ্ট ক্লিয়ার করতে এই পোস্ট টা দেয়া

স্ট্রিং প্রসেসিং এর আগে ভাবছি পয়েন্টার আর অ্যারে কনসেপ্টটাও ক্লিয়ার করে নিবো

যাই হোক স্ট্রিং ৩ ভাবে প্রসেস হয়..String processes in 3 types
They are Insertion,Deletion and Replace

Insertion in string:

Suppose:T=Text,P=position,S=string
INSERT(T,P,S)
Example:
INSERT(“ABCDEFG”,3,”xyz”)=”ABxyzCDEFG”

Deletion in string:

Suppose:T=Text,P=position,L=Length
pseudo code for deletion
DELETE(T,P,L)
Example:
DELETE(“ABCDEFG”,4,2)=”ABCDFG”

Replacement in string:

Suppose:T=Text,P1=position1,P2=position2
pseudo code for replacing
REPLACE(T,P1,P2)
Example:
REPLACE(“MASUD KARIM”,”D”,”M”)=”MASUM KARIM”