Created
August 3, 2016 13:27
-
-
Save HammadMaqbool/04c38969b00438b4ec077a1edeaed617 to your computer and use it in GitHub Desktop.
Turbo C++ Code to Delete String
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Temp{ | |
public: | |
Delete() | |
{ | |
char a[100],st1[100]; | |
int r=0,i=0; | |
cout<<"Enter a String"<<endl; | |
cin>>a; | |
int loc; | |
cout<<"Enter initial position"; | |
cin>>loc; | |
int finalp; | |
cout<<"Final position"; | |
cin>>finalp; | |
for( i=0;i<=loc-1;i++,r++) | |
st1[r]=a[i]; | |
for(i=loc+finalp;a[i]!='\0';i++,r++) | |
st1[r]=a[i]; | |
st1[r]='\0'; | |
cout<<st1; | |
} | |
}; | |
void main() | |
{ | |
Temp obj; | |
obj.Delete(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment