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

C / C++ / MFC

 
GeneralRe: I need help with dialogs please Pin
RobJones17-Jan-03 14:44
RobJones17-Jan-03 14:44 
GeneralRe: I need help with dialogs please Pin
RobJones17-Jan-03 15:00
RobJones17-Jan-03 15:00 
GeneralRe: I need help with dialogs please Pin
toey17-Jan-03 19:14
toey17-Jan-03 19:14 
GeneralHttpSendRequest Pin
Paul M Watt17-Jan-03 11:51
mentorPaul M Watt17-Jan-03 11:51 
GeneralRe: HttpSendRequest Pin
Todd Smith17-Jan-03 13:54
Todd Smith17-Jan-03 13:54 
GeneralRe: HttpSendRequest Pin
Paul M Watt17-Jan-03 20:39
mentorPaul M Watt17-Jan-03 20:39 
GeneralRe: HttpSendRequest Pin
geo_m18-Jan-03 2:15
geo_m18-Jan-03 2:15 
GeneralPassing structs by pointer rather than reference Pin
Dean Goodman17-Jan-03 11:39
Dean Goodman17-Jan-03 11:39 
I've often wondered what is the reasoning behind passing structs by pointers rather than by reference. Can anyone give me a good motivation for choosing one over the other? I see it all the time in MFC -- is it just MS standard?

For instance, if I have the following:

typedef struct POINT
{
   double x;
   double y;
} tagPOINT, *LPPOINT;
 
void GetCurrLoc(LPPOINT pt)
{
   pt->x = 3.2;
   pt->y = 2.4;
}
 
void GetCurrLoc(POINT& pt)
{
   pt.x = 3.2;
   pt.y = 2.4;
}


Is one any better than the other, besides the fact that passing by pointer is (slightly) easier when using dynamically allocated structs.

Thanks,

Dean
GeneralRe: Passing structs by pointer rather than reference Pin
Maximilien17-Jan-03 11:46
Maximilien17-Jan-03 11:46 
GeneralRe: Passing structs by pointer rather than reference Pin
Jörgen Sigvardsson17-Jan-03 12:10
Jörgen Sigvardsson17-Jan-03 12:10 
GeneralRe: Passing structs by pointer rather than reference Pin
Maximilien17-Jan-03 12:59
Maximilien17-Jan-03 12:59 
GeneralRe: Passing structs by pointer rather than reference Pin
Jörgen Sigvardsson17-Jan-03 14:34
Jörgen Sigvardsson17-Jan-03 14:34 
GeneralRe: Passing structs by pointer rather than reference Pin
Jörgen Sigvardsson17-Jan-03 15:05
Jörgen Sigvardsson17-Jan-03 15:05 
GeneralRe: Passing structs by pointer rather than reference Pin
Tim Smith17-Jan-03 12:59
Tim Smith17-Jan-03 12:59 
GeneralRe: Passing structs by pointer rather than reference Pin
Jörgen Sigvardsson17-Jan-03 14:46
Jörgen Sigvardsson17-Jan-03 14:46 
GeneralRe: Passing structs by pointer rather than reference Pin
Gary R. Wheeler18-Jan-03 14:18
Gary R. Wheeler18-Jan-03 14:18 
GeneralRe: Passing structs by pointer rather than reference Pin
Jörgen Sigvardsson18-Jan-03 14:39
Jörgen Sigvardsson18-Jan-03 14:39 
GeneralRe: Passing structs by pointer rather than reference Pin
Tim Smith17-Jan-03 13:02
Tim Smith17-Jan-03 13:02 
GeneralRe: Passing structs by pointer rather than reference Pin
Dean Goodman17-Jan-03 13:11
Dean Goodman17-Jan-03 13:11 
GeneralCreating and Using a DLL in Dev-C++ Pin
Aidman17-Jan-03 11:29
Aidman17-Jan-03 11:29 
GeneralFile open and loop Pin
Doug3317-Jan-03 11:22
Doug3317-Jan-03 11:22 
GeneralRe: File open and loop Pin
Dean Goodman17-Jan-03 12:43
Dean Goodman17-Jan-03 12:43 
GeneralRe: File open and loop Pin
Mike Nordell17-Jan-03 23:31
Mike Nordell17-Jan-03 23:31 
GeneralMemory leak Pin
Shay Harel17-Jan-03 10:17
Shay Harel17-Jan-03 10:17 
GeneralRe: Memory leak Pin
AlexO17-Jan-03 10:31
AlexO17-Jan-03 10: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.