Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionreading a string from a file Pin
SWDevil2-Mar-06 5:33
SWDevil2-Mar-06 5:33 
AnswerRe: reading a string from a file Pin
David Crow2-Mar-06 6:34
David Crow2-Mar-06 6:34 
GeneralRe: reading a string from a file Pin
SWDevil2-Mar-06 8:14
SWDevil2-Mar-06 8:14 
GeneralRe: reading a string from a file Pin
David Crow2-Mar-06 8:28
David Crow2-Mar-06 8:28 
GeneralRe: reading a string from a file Pin
SWDevil2-Mar-06 8:36
SWDevil2-Mar-06 8:36 
GeneralRe: reading a string from a file Pin
Wes Aday2-Mar-06 9:09
professionalWes Aday2-Mar-06 9:09 
GeneralRe: reading a string from a file Pin
Wes Aday2-Mar-06 9:11
professionalWes Aday2-Mar-06 9:11 
Questionchar buff !! :( Pin
Eytukan2-Mar-06 5:14
Eytukan2-Mar-06 5:14 
<code>
typedef struct alcPacket
{
	char workStationID[20];
	char NTLogin[20];
}*alcPacket_t;
</code>


Sender :

<code>
alcPacket_t alcp;
strcpy(alcp->NTLogin,"xyz");
strcpy(alcp->workStation,"yahoo");

nRet = sendto(hSocket,(char*)alcp,sizeof(alcPacket),0,(struct sockaddr*)&stDstAddr,sizeof(stDstAddr));
</code>


Receiver :
<code>
alcPacket_t alcp;

nRet = recvfrom(hSocket,achInBuf,120,0,(struct sockaddr*)&stSrcAddr,&addr_size);

	alcp = (alcPacket_t)achInBuf;
	printf("%s",alcp->NTLogin);
	printf("%s",alcp->workStationID);

</code>


Everthing works fine.. but i get a the output for NTLogin is preceded by a long streak of ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌxyz
the out put looks like

ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌxyz
Yahoo

ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌxyz
yahoo

how can i remove that junk from NTLogin? Frown | :( what's wrong?Unsure | :~



VuNic
AnswerRe: char buff !! :( Pin
Phil.Benson2-Mar-06 5:26
professionalPhil.Benson2-Mar-06 5:26 
AnswerRe: char buff !! :( Pin
David Crow2-Mar-06 6:36
David Crow2-Mar-06 6:36 
GeneralRe: char buff !! :( Pin
Eytukan6-Mar-06 22:40
Eytukan6-Mar-06 22:40 
GeneralRe: char buff !! :( Pin
Eytukan6-Mar-06 22:49
Eytukan6-Mar-06 22:49 
GeneralRe: char buff !! :( Pin
ThatsAlok10-Mar-06 14:57
ThatsAlok10-Mar-06 14:57 
GeneralRe: char buff !! :( Pin
Eytukan15-Mar-06 5:17
Eytukan15-Mar-06 5:17 
QuestionProper way to save files in dialog app? Pin
ldsdbomber2-Mar-06 4:45
ldsdbomber2-Mar-06 4:45 
AnswerRe: Proper way to save files in dialog app? Pin
Roger Stoltz2-Mar-06 7:46
Roger Stoltz2-Mar-06 7:46 
QuestionMessageQ inside member function Pin
RichardS2-Mar-06 4:24
RichardS2-Mar-06 4:24 
AnswerRe: MessageQ inside member function Pin
Stephen Hewitt2-Mar-06 13:04
Stephen Hewitt2-Mar-06 13:04 
GeneralRe: MessageQ inside member function Pin
RichardS2-Mar-06 21:12
RichardS2-Mar-06 21:12 
QuestionQuestion about richedits Pin
KellyR2-Mar-06 4:22
KellyR2-Mar-06 4:22 
QuestionGetting USB flash drive lettter from vendor & product ID Pin
zebelge2-Mar-06 4:10
zebelge2-Mar-06 4:10 
Question"Catching" messages to the tab control on a PropertySheet? Pin
Phil.Benson2-Mar-06 4:02
professionalPhil.Benson2-Mar-06 4:02 
AnswerRe: "Catching" messages to the tab control on a PropertySheet? Pin
Phil.Benson3-Mar-06 0:05
professionalPhil.Benson3-Mar-06 0:05 
Questionwhat can mingw do for me? Pin
derek72-Mar-06 2:34
derek72-Mar-06 2:34 
AnswerRe: what can mingw do for me? Pin
walter762-Mar-06 3:31
walter762-Mar-06 3:31 

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.