Click here to Skip to main content
15,902,777 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to return NULL when return type is user defined Pin
Anonymous20-Jun-03 13:07
Anonymous20-Jun-03 13:07 
AnswerRe: How to return NULL when return type is user defined Pin
nfactorial20-Jun-03 13:24
nfactorial20-Jun-03 13:24 
GeneralRe: How to return NULL when return type is user defined Pin
Hashim Saleem20-Jun-03 13:37
Hashim Saleem20-Jun-03 13:37 
GeneralRe: How to return NULL when return type is user defined Pin
nfactorial20-Jun-03 13:47
nfactorial20-Jun-03 13:47 
GeneralRe: How to return NULL when return type is user defined Pin
Hashim Saleem20-Jun-03 14:13
Hashim Saleem20-Jun-03 14:13 
GeneralRe: How to return NULL when return type is user defined Pin
nfactorial20-Jun-03 14:37
nfactorial20-Jun-03 14:37 
GeneralRe: How to return NULL when return type is user defined Pin
Hashim Saleem20-Jun-03 15:06
Hashim Saleem20-Jun-03 15:06 
AnswerRe: How to return NULL when return type is user defined Pin
Neville Franks20-Jun-03 13:32
Neville Franks20-Jun-03 13:32 
You can do several things. First I would change it to:
bool findPoint( Point& ptFound, Point p );


Another option is to keep your original code and set the returned Point to a value that would never occur in practice. eg. -1,-1. Then you could write:
IsPointValid( ptFound = findPoint( point ) )


You can and should also make the function const. You can also return a const ptr, which doesn't break your OOP rule. Solution 3. Use const wherever possible.

There you - pick 1.

Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
Generaldrive information Pin
snipes20-Jun-03 12:48
snipes20-Jun-03 12:48 
GeneralRe: drive information Pin
kochhar20-Jun-03 18:45
kochhar20-Jun-03 18:45 
QuestionVisual C++ profiler? Pin
Marcus Spitzmiller20-Jun-03 11:44
Marcus Spitzmiller20-Jun-03 11:44 
AnswerRe: Visual C++ profiler? Pin
Saqib Razzaq20-Jun-03 12:28
Saqib Razzaq20-Jun-03 12:28 
GeneralRe: Visual C++ profiler? Pin
Marcus Spitzmiller20-Jun-03 15:43
Marcus Spitzmiller20-Jun-03 15:43 
QuestionHow to replace default keys behaivour in Edit control Pin
Saqib Razzaq20-Jun-03 10:42
Saqib Razzaq20-Jun-03 10:42 
AnswerRe: How to replace default keys behaivour in Edit control Pin
User 665820-Jun-03 10:48
User 665820-Jun-03 10:48 
GeneralRe: How to replace default keys behaivour in Edit control Pin
Saqib Razzaq20-Jun-03 11:12
Saqib Razzaq20-Jun-03 11:12 
GeneralRe: How to replace default keys behaivour in Edit control Pin
User 665820-Jun-03 11:23
User 665820-Jun-03 11:23 
GeneralSerialize Pin
Anthony988720-Jun-03 10:12
Anthony988720-Jun-03 10:12 
GeneralRe: Serialize Pin
Saqib Razzaq20-Jun-03 10:30
Saqib Razzaq20-Jun-03 10:30 
GeneralRe: Serialize Pin
Anthony988720-Jun-03 10:40
Anthony988720-Jun-03 10:40 
GeneralRe: Serialize Pin
basementman20-Jun-03 11:03
basementman20-Jun-03 11:03 
QuestionIs this possible? Pin
User 988520-Jun-03 9:38
User 988520-Jun-03 9:38 
AnswerRe: Is this possible? Pin
valikac20-Jun-03 10:48
valikac20-Jun-03 10:48 
GeneralSeraching a key(s) in ODBC Pin
Scozturk20-Jun-03 8:28
professionalScozturk20-Jun-03 8:28 
GeneralRe: Seraching a key(s) in ODBC Pin
Jeremy Falcon20-Jun-03 9:18
professionalJeremy Falcon20-Jun-03 9:18 

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.