Click here to Skip to main content
15,910,121 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: removing a char array from another Pin
Rickard Andersson2022-Nov-03 5:38
Rickard Andersson2022-Nov-03 5:38 
GeneralPlease help with Threads Pin
tqdo21-Nov-03 11:59
tqdo21-Nov-03 11:59 
GeneralRe: Please help with Threads Pin
Peter Molnar21-Nov-03 12:16
Peter Molnar21-Nov-03 12:16 
GeneralShifting elements of struct over to next element.. Pin
IrishSonic21-Nov-03 10:49
IrishSonic21-Nov-03 10:49 
GeneralRe: Shifting elements of struct over to next element.. Pin
Michael Dunn21-Nov-03 11:14
sitebuilderMichael Dunn21-Nov-03 11:14 
GeneralInserting a char array into another Pin
thunderflash2121-Nov-03 10:47
thunderflash2121-Nov-03 10:47 
GeneralRe: Inserting a char array into another Pin
m0xx21-Nov-03 11:48
m0xx21-Nov-03 11:48 
GeneralSOCKADDR_IN structure port conversion Pin
Kuniva21-Nov-03 10:06
Kuniva21-Nov-03 10:06 
Hi, i need to get the port number from a SOCKADDR_IN structure but for some reason i always get a wrong number. Either the number is too big (out of the valid port range) or it is some weird number that cant be the real port since the port number is known to me. This is my code:

struct sockaddr_in * sin;
sin = (struct sockaddr_in*)name->sa_data;

char sport[10];
memset(sport,0,10);
unsigned short int port = ntohs(sin->sin_port);
sprintf(sport,"%u",&port);

name is of type struct sockaddr* and points to a valid sockaddr structure. For some reason i never get the right port number in sport. I can't understand why. I also tried "%i" in the format string for sprintf().

Kuniva
--------------------------------------------
GeneralRe: SOCKADDR_IN structure port conversion Pin
Mike Dimmick21-Nov-03 13:05
Mike Dimmick21-Nov-03 13:05 
GeneralRe: SOCKADDR_IN structure port conversion Pin
Kuniva22-Nov-03 1:08
Kuniva22-Nov-03 1:08 
GeneralTrimLeft() question Pin
speedpacer21-Nov-03 9:44
speedpacer21-Nov-03 9:44 
GeneralRe: TrimLeft() question Pin
speedpacer21-Nov-03 10:07
speedpacer21-Nov-03 10:07 
GeneralRe: TrimLeft() question Pin
speedpacer21-Nov-03 11:00
speedpacer21-Nov-03 11:00 
GeneralRe: TrimLeft() question Pin
John R. Shaw21-Nov-03 11:24
John R. Shaw21-Nov-03 11:24 
GeneralRe: TrimLeft() question Pin
speedpacer21-Nov-03 12:21
speedpacer21-Nov-03 12:21 
GeneralRe: TrimLeft() question Pin
Mike Dimmick21-Nov-03 13:10
Mike Dimmick21-Nov-03 13:10 
GeneralPrinting and Bitmap Coding. Pin
krondorl21-Nov-03 8:50
krondorl21-Nov-03 8:50 
GeneralRe: Printing and Bitmap Coding. Pin
John R. Shaw21-Nov-03 11:59
John R. Shaw21-Nov-03 11:59 
GeneralRe: Printing and Bitmap Coding. Pin
krondorl22-Nov-03 5:30
krondorl22-Nov-03 5:30 
GeneralRe: Printing and Bitmap Coding. Pin
John R. Shaw22-Nov-03 7:12
John R. Shaw22-Nov-03 7:12 
GeneralVisual Studio.net 2003 Pin
(Steven Hicks)n+121-Nov-03 7:57
(Steven Hicks)n+121-Nov-03 7:57 
GeneralRe: Visual Studio.net 2003 Pin
Mike Dimmick21-Nov-03 13:15
Mike Dimmick21-Nov-03 13:15 
QuestionPrinting the contents of a CListCtrl ? Pin
Brian van der Beek21-Nov-03 5:27
Brian van der Beek21-Nov-03 5:27 
AnswerRe: Printing the contents of a CListCtrl ? Pin
Roger Allen21-Nov-03 6:29
Roger Allen21-Nov-03 6:29 
GeneralRe: Printing the contents of a CListCtrl ? Pin
Brian van der Beek23-Nov-03 21:25
Brian van der Beek23-Nov-03 21:25 

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.