Wednesday, June 22, 2022

OPERATOR IN STRING

 #include<iostream>

#include<cstring>


using namespace std;


int main()

{

    string str1="the devil is me";

    string str2=" oh really";

    cout<<str1.substr(3);

    cout<<str1.compare(str2);

    str1[4]='F';

    cout<<str1<<endl;

    str1=str1+str2;

    cout<<str1<<endl;

    return 0;

}

No comments:

Post a Comment

CONSTRUCTURE IN PARENT CLASS

class Parent {     public Parent()     {         System.out.println("Parent Constrcutor");     }              } class Child extend...