Click here to Skip to main content
15,912,977 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Sinh Calculator Pin
toxcct11-Jan-06 6:17
toxcct11-Jan-06 6:17 
Questionchar buf Pin
Smith#11-Jan-06 3:04
Smith#11-Jan-06 3:04 
AnswerRe: char buf Pin
sunit511-Jan-06 3:09
sunit511-Jan-06 3:09 
AnswerRe: char buf Pin
benjymous11-Jan-06 3:22
benjymous11-Jan-06 3:22 
GeneralRe: char buf Pin
Smith#11-Jan-06 3:30
Smith#11-Jan-06 3:30 
GeneralRe: char buf Pin
benjymous11-Jan-06 7:30
benjymous11-Jan-06 7:30 
GeneralRe: char buf Pin
Eytukan11-Jan-06 3:43
Eytukan11-Jan-06 3:43 
AnswerRe: char buf Pin
Nish Nishant11-Jan-06 3:59
sitebuilderNish Nishant11-Jan-06 3:59 
AnswerRe: char buf Pin
vipinasda11-Jan-06 4:43
vipinasda11-Jan-06 4:43 
AnswerRe: char buf Pin
lemur211-Jan-06 4:50
lemur211-Jan-06 4:50 
GeneralRe: char buf Pin
Sebastian Schneider11-Jan-06 5:12
Sebastian Schneider11-Jan-06 5:12 
AnswerRe: char buf Pin
Sebastian Schneider11-Jan-06 5:10
Sebastian Schneider11-Jan-06 5:10 
AnswerAnswer!! Pin
Eytukan11-Jan-06 5:25
Eytukan11-Jan-06 5:25 
AnswerRe: char buf Pin
Bob Stanneveld11-Jan-06 10:31
Bob Stanneveld11-Jan-06 10:31 
Hello,

I don't know why nobody give the answer: std::istringstream. This class is designed to build strings of unknown length by appending segments to the buffer (stream) just like you would use std::cout. The code would look like:
// Use a character buffer for reading characters from the socket. 
// Make sure that a '\0' follows the character sequence, otherwise the behaviour 
// of the istringstream class is undefined.
std::istringstream istrInputString;
char cBuf[100] = {0}; 
while( /* there are bytes from your socket */
{
    /* read bytes from socket and appen terminating null character. */
    istrInputString << cBuf;
}

// Do something with the string.


See MSDN[^] for more details.

Hope this helps. Smile | :)

Behind every great black man...
            ... is the police. - Conspiracy brother


Blog[^]
GeneralRe: char buf Pin
Tim Smith11-Jan-06 11:52
Tim Smith11-Jan-06 11:52 
GeneralRe: char buf Pin
Bob Stanneveld12-Jan-06 22:19
Bob Stanneveld12-Jan-06 22:19 
AnswerRe: char buf Pin
Stephen Hewitt11-Jan-06 15:34
Stephen Hewitt11-Jan-06 15:34 
QuestionPermissions and fopen Pin
Chris Meech11-Jan-06 3:02
Chris Meech11-Jan-06 3:02 
AnswerRe: Permissions and fopen Pin
vipinasda11-Jan-06 4:53
vipinasda11-Jan-06 4:53 
GeneralRe: Permissions and fopen Pin
Chris Meech11-Jan-06 6:17
Chris Meech11-Jan-06 6:17 
GeneralRe: Permissions and fopen Pin
__yb11-Jan-06 11:36
__yb11-Jan-06 11:36 
GeneralRe: Permissions and fopen Pin
vipinasda11-Jan-06 16:23
vipinasda11-Jan-06 16:23 
GeneralRe: Permissions and fopen Pin
__yb11-Jan-06 23:52
__yb11-Jan-06 23:52 
QuestionON_NOTIFY_RANGE and Textbox's KillFocus Pin
Sarvan AL11-Jan-06 2:31
Sarvan AL11-Jan-06 2:31 
AnswerRe: ON_NOTIFY_RANGE and Textbox's KillFocus Pin
Cedric Moonen11-Jan-06 2:33
Cedric Moonen11-Jan-06 2:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.