Click here to Skip to main content
16,007,885 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
Gary R. Wheeler wrote:
It certainly is possible to pass a reference to NULL:

I know, I tried it in VS.NET the other night. Smile | :) I was just too tired to mention it, and it didn't really have any relevance with respect to my argument.


Gary R. Wheeler wrote:
In this case, inside the StuffFunction you can't tell that NULL has been passed in.

Well, you could always do if(&stuff_item == NULL), assuming Stuff doesn't override operator&.


Gary R. Wheeler wrote:
Pointers are easier to get sloppy with if you're not careful.

The only extra support a reference gives you is that you have to initialize it. Which is certainly nice since the compiler can yell Error!

I think I'll experiment some tomorrow to see if I can eliminate the use of pointers (to see if it's possible). I have some ideas I want to try out... Smile | :)

--
There's a new game we like to play you see. A game with added reality. You treat me like a dog, get me down on my knees.

We call it master and servant.

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 
GeneralRe: Memory leak Pin
Shay Harel17-Jan-03 10:40
Shay Harel17-Jan-03 10:40 
GeneralRe: Memory leak Pin
AlexO17-Jan-03 11:08
AlexO17-Jan-03 11:08 
GeneralRe: Memory leak Pin
Shay Harel17-Jan-03 15:26
Shay Harel17-Jan-03 15:26 
GeneralCString Casting! Pin
Alex H 198317-Jan-03 10:06
Alex H 198317-Jan-03 10:06 
GeneralRe: CString Casting! Pin
Shay Harel17-Jan-03 10:12
Shay Harel17-Jan-03 10:12 
GeneralRe: CString Casting! Pin
Pavel Klocek17-Jan-03 10:13
Pavel Klocek17-Jan-03 10:13 
GeneralRe: CString Casting! Pin
HENDRIK R17-Jan-03 10:15
HENDRIK R17-Jan-03 10:15 
GeneralRe: CString Casting! Pin
HENDRIK R17-Jan-03 10:17
HENDRIK R17-Jan-03 10:17 
Generalchanging directorys Pin
(Steven Hicks)n+117-Jan-03 8:33
(Steven Hicks)n+117-Jan-03 8: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.