N
Nathan Young
Hello all,
I am a newbie to C++ (but have been writing C for a while).
I am trying to write a simple TCP/IP program in C++, and am really
struggling with string manipluation. I would appreciate any pointers
to good web tutorials on the String class and manipulating strings.
For example. I have a integer variable 'count' which I would like to
transmit on the TCP stream. I have the stream up and running, and can
transmit static messages using the following code:
String* tempbuf = new String(S"Test data");
Byte myWriteBuffer[] =Text::Encoding::ASCII->GetBytes(tempbuf);
stream->Write(myWriteBuffer, 0, myWriteBuffer->Length);
How would I capture the value of count into the tempbuf string?
In C, I would do something like this...
sprintf(&tempbuf,"Test data, count value: %d",count);
....But I can't figure out the equivalent function with the String
class.
Thanks,
Nathan
I am a newbie to C++ (but have been writing C for a while).
I am trying to write a simple TCP/IP program in C++, and am really
struggling with string manipluation. I would appreciate any pointers
to good web tutorials on the String class and manipulating strings.
For example. I have a integer variable 'count' which I would like to
transmit on the TCP stream. I have the stream up and running, and can
transmit static messages using the following code:
String* tempbuf = new String(S"Test data");
Byte myWriteBuffer[] =Text::Encoding::ASCII->GetBytes(tempbuf);
stream->Write(myWriteBuffer, 0, myWriteBuffer->Length);
How would I capture the value of count into the tempbuf string?
In C, I would do something like this...
sprintf(&tempbuf,"Test data, count value: %d",count);
....But I can't figure out the equivalent function with the String
class.
Thanks,
Nathan