C++net and strings

FlyBoy

Well-known member
Joined
Sep 6, 2004
Messages
106
im kinda newbie to c++...
i have a question about strings...
i want to connect to strings...

i have this

string* str1;

i have this : "Joe" and "fly"
i want str1 to be equal to "Joe Fly"

a simple way in vbnet is.
dim str1 as string

str1="joe" & "fly"
how to do it in vc++net???

and another question...how to add new lines? (like in vbnet..Vbcrlf,or vbnewline)???
 
i assume you are using managed C++ ( windows forms ) , heres one way...
C#:
	String * str = "Joe ";
	String * str1 = "Fly";
	String * str2 = "\nSome stuff on a newline"; /// \n being a new line
	String * result = String::Concat(str,str1,str2); /// String::Concat joins an array of strings together
	MessageBox::Show(result);
 
dynamic_sysop said:
i assume you are using managed C++ ( windows forms ) , heres one way...
C#:
	String * str = "Joe ";
	String * str1 = "Fly";
	String * str2 = "\nSome stuff on a newline"; /// \n being a new line
	String * result = String::Concat(str,str1,str2); /// String::Concat joins an array of strings together
	MessageBox::Show(result);


10x!!!! it works...
 
Back
Top