| | |
what is the use of "&" here
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2006
Posts: 32
Reputation:
Solved Threads: 0
look at "dc.SelectObject(&pen)" and "dc.SelectObject (&brush)",here no matter I use "&" or not it results the same. why is that?
C Syntax (Toggle Plain Text)
void CMainWindow::OnPaint () { CPaintDC dc (this); CBrush brush (RGB (255, 0, 0)); CPen pen (PS_NULL, 0, (RGB (0, 0, 0))); dc.SelectObject(&pen); dc.SelectObject (&brush); dc.Ellipse (0, 0, 200, 100); }
Last edited by Salem; Sep 22nd, 2006 at 5:56 pm. Reason: tagging
> here no matter I use "&" or not it results the same.
Well one or the other is going to produce at least a compiler warning. Choose the one which compiles cleanly.
> why is that?
Sometimes, despite the programmers' best efforts to make a mess of it, it still manages to produce the expected result.
Never confuse "expected results" and "bug free" as meaning the same thing.
Well one or the other is going to produce at least a compiler warning. Choose the one which compiles cleanly.
> why is that?
Sometimes, despite the programmers' best efforts to make a mess of it, it still manages to produce the expected result.
Never confuse "expected results" and "bug free" as meaning the same thing.
![]() |
Similar Threads
- google "keyword" question (Search Engine Optimization)
- IE problem with "about:blank" & "search for..." (Viruses, Spyware and other Nasties)
- Spyware Removal Help!!! "Lookfor" & god knows what else... (Web Browsers)
Other Threads in the C Forum
- Previous Thread: what is the use of "pOldPen" here?
- Next Thread: help me ? Application crashing before main
| Thread Tools | Search this Thread |
#include * ansi array arrays asterisks bash binarysearch centimeter changingto char character convert copyimagefile cprogramme creafecopyofanytypeoffileinc database dynamic execv feet fgets file floatingpointvalidation fork framework function getlogicaldrivestrin givemetehcodez grade gtkwinlinux hacking histogram ide inches include incrementoperators infiniteloop initialization input interest intmain() iso kernel keyboard kilometer license linked linkedlist linux list lists locate looping lowest matrix meter microsoft number oddnumber opendocumentformat openwebfoundation overwrite owf pdf pointer posix power probleminc process program programming radix recursion recv recvblocked research reversing scripting segmentationfault sequential single socket socketprograming socketprogramming standard strchr string suggestions systemcall test testing threads turboc unix urboc user variable wab whythiscodecausesegmentationfault windowsapi






