Skip to content

Instantly share code, notes, and snippets.

@HammadMaqbool
Created August 3, 2016 13:27
Show Gist options
  • Save HammadMaqbool/04c38969b00438b4ec077a1edeaed617 to your computer and use it in GitHub Desktop.
Save HammadMaqbool/04c38969b00438b4ec077a1edeaed617 to your computer and use it in GitHub Desktop.
Turbo C++ Code to Delete String
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