String Library Functions
String Library Functions
com/c/ComputerScienceAcademy7
video link : h ps://youtu.be/3oLUIE9VtGw
/*
String func ons : C++ Compiler has a large set of useful string handling
library func os.
header file <string.h>
/* #include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
clrscr();
getch();
}
*/
/*
2. strcpy() : This func on copies the content of one string into
another.
*/
/* #include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
clrscr();
cout<<"line 1 = "<<line1<<endl;
cout<<"line 2 = "<<line2;
getch();
}
*/
/*
3. strcat() : This func on concatenates the source string at the end
of the target string.
*/
/*
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
clrscr();
cout<<"line 1 = "<<line1<<endl;
cout<<"line 2 = "<<line2;
getch();
}
*/
/*
void main()
{
clrscr();
strupr(line1);
strlwr(line2);
cout<<"line 1 = "<<line1<<endl;
cout<<"line 2 = "<<line2;
getch();
}
*/
/*
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
clrscr();
strrev(line1);
strrev(line2);
cout<<"line 1 = "<<line1<<endl;
cout<<"line 2 = "<<line2;
getch();
}
*/
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
clrscr();
cout<<diff<<endl;
if(diff == 0)
cout<<"both are same";
else
cout<<"they are different";
getch();
}
*/
/* WAP in C++ to read any word or text of line and check whether it is
palindrome word/text or not; */
/* #include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
clrscr();
if(diff == 0)
cout<<"Its palindrome word";
else
cout<<"Its not palindrome word";
getch();
}
*/