Click here to Skip to main content
15,908,842 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Please tell me whats wrong with function? Pin
David Crow17-Nov-10 3:15
David Crow17-Nov-10 3:15 
Question#ifndef Pin
vidhyaej16-Nov-10 20:21
vidhyaej16-Nov-10 20:21 
AnswerRe: #ifndef Pin
Alain Rist16-Nov-10 21:04
Alain Rist16-Nov-10 21:04 
AnswerRe: #ifndef Pin
David Crow17-Nov-10 3:16
David Crow17-Nov-10 3:16 
QuestionHow can handle this exception? Pin
Le@rner16-Nov-10 19:00
Le@rner16-Nov-10 19:00 
AnswerRe: How can handle this exception? Pin
Alain Rist16-Nov-10 21:00
Alain Rist16-Nov-10 21:00 
GeneralRe: How can handle this exception? [modified] Pin
Le@rner16-Nov-10 21:06
Le@rner16-Nov-10 21:06 
GeneralRe: How can handle this exception? Pin
Cedric Moonen16-Nov-10 21:17
Cedric Moonen16-Nov-10 21:17 
GeneralRe: How can handle this exception? Pin
Alain Rist16-Nov-10 21:23
Alain Rist16-Nov-10 21:23 
GeneralRe: How can handle this exception? Pin
Le@rner16-Nov-10 22:41
Le@rner16-Nov-10 22:41 
GeneralRe: How can handle this exception? Pin
Cedric Moonen16-Nov-10 22:51
Cedric Moonen16-Nov-10 22:51 
AnswerRe: How can handle this exception? Pin
Alain Rist16-Nov-10 22:55
Alain Rist16-Nov-10 22:55 
GeneralRe: How can handle this exception? Pin
Le@rner16-Nov-10 23:15
Le@rner16-Nov-10 23:15 
GeneralRe: How can handle this exception? Pin
Cedric Moonen16-Nov-10 23:43
Cedric Moonen16-Nov-10 23:43 
GeneralRe: How can handle this exception? Pin
Alain Rist17-Nov-10 0:05
Alain Rist17-Nov-10 0:05 
GeneralRe: How can handle this exception? Pin
Cedric Moonen16-Nov-10 23:41
Cedric Moonen16-Nov-10 23:41 
GeneralRe: How can handle this exception? Pin
Alain Rist17-Nov-10 0:11
Alain Rist17-Nov-10 0:11 
GeneralRe: How can handle this exception? Pin
Le@rner17-Nov-10 0:35
Le@rner17-Nov-10 0:35 
GeneralRe: How can handle this exception? Pin
Alain Rist17-Nov-10 1:29
Alain Rist17-Nov-10 1:29 
QuestionRe: How can handle this exception? Pin
David Crow17-Nov-10 3:19
David Crow17-Nov-10 3:19 
Questionbuffer filled with trash [modified] Pin
ALLERSLIT16-Nov-10 13:22
ALLERSLIT16-Nov-10 13:22 
Hey I googled for this kinda stuff but only useless stuff came up..
Anyway

char buffer[250];
send(sock, "hello?\n", 8, 0);
recv(sock, buffer, sizeof(buffer), 0);
cout << buffer << endl;
cin.get();


is my code.

Now I obviously do not know how big the buffer will be, the problem is if i set buffer[250], everything after the actual content is trash.
How would I fix that?
Like I wanna see only the actual content and not the jibberish after it.

Thanks.


e// nevermind, I just found out that recv returns the size..
modified on Tuesday, November 16, 2010 7:57 PM

AnswerRe: buffer filled with trash Pin
Stephen Hewitt16-Nov-10 17:35
Stephen Hewitt16-Nov-10 17:35 
GeneralRe: buffer filled with trash Pin
Richard MacCutchan16-Nov-10 21:22
mveRichard MacCutchan16-Nov-10 21:22 
QuestionAccessing vector in another class?? Pin
AmbiguousName16-Nov-10 0:53
AmbiguousName16-Nov-10 0:53 
AnswerRe: Accessing vector in another class?? Pin
Chris Losinger16-Nov-10 1:37
professionalChris Losinger16-Nov-10 1:37 

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.