Mix strings [beginner]

I was wondering how can i combine "mystring" to "url"

string mystring = "com";
wstring url = L"http://www.google.";

in java it could simply be http://www.google. +mystring;
but it not work thay way here. please help
Last edited on
closed account (S6k9GNh0)
If using std::string, the + operator, allows concantenation with other literal strings.

EDIT: I though this was the case but I can't find it in the reference for some reason. If that doesn't work, try append();.
Last edited on
i would rather add these as two separate arrays, i assume that your refering to C/C++ programming

unsigned char ext[]="com";
unsigned char url[]="http://www.google.";
int count=0x00;

for(count=0;count<=5;count++)
{
url[count+18]=ext[count];
}

this should place the strings together

if you looking for some website style coding, visit www.w3schools.com
bytefreez : Why is that easier than
1
2
3
4
string str1 = "com";
string str2 = "http://www.google.";

string str3 = str1 + str2;

?

http://cplusplus.com/reference/string/operator+/

For concating wstring and string, you have to convert either one to the other type.
Just found:
http://www.codeguru.com/forum/archive/index.php/t-193852.html
Topic archived. No new replies allowed.