By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,599 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,599 IT Pros & Developers. It's quick & easy.

String

P: 1
How can i insert a string without using string copy ?
Nov 11 '06 #1
Share this Question
Share on Google+
1 Reply


abdoelmasry
100+
P: 104
Hi avnishcapri
sorry yourquestion is not clear , ok
if you want to insert some words in string
this code may Help:


#include <iostream>
#include<string>
#include<conio.h>
using namespace std;
int main()
{
string abdo="I Love ";
int position=abdo.length();
cout<<abdo.insert(position,"EGYPT");
getch();
return 0;
}
Nov 11 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.