Click here to Skip to main content
15,880,972 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Difference between Typedef and #define? Pin
normanS12-Feb-06 20:14
normanS12-Feb-06 20:14 
AnswerRe: Difference between Typedef and #define? Pin
Ryan Binns9-Feb-06 21:41
Ryan Binns9-Feb-06 21:41 
GeneralRe: Difference between Typedef and #define? Pin
jhwurmbach10-Feb-06 3:09
jhwurmbach10-Feb-06 3:09 
GeneralRe: Difference between Typedef and #define? Pin
Blake Miller10-Feb-06 4:13
Blake Miller10-Feb-06 4:13 
GeneralRe: Difference between Typedef and #define? Pin
jhwurmbach10-Feb-06 4:23
jhwurmbach10-Feb-06 4:23 
GeneralRe: Difference between Typedef and #define? Pin
Blake Miller10-Feb-06 4:28
Blake Miller10-Feb-06 4:28 
GeneralRe: Difference between Typedef and #define? Pin
jhwurmbach10-Feb-06 4:34
jhwurmbach10-Feb-06 4:34 
GeneralRe: Difference between Typedef and #define? Pin
Blake Miller10-Feb-06 4:41
Blake Miller10-Feb-06 4:41 
We use goto a lot in functions that call other functions returning error codes.

suppose some pseudo-code like this...



if string pointer is null or string is empty
set error code
goto funcexit

if file can not be opened
set error code
goto funcexit

if file read error happens
set error code
goto funcexit

if memory allocation for structure fails
set error code
goto funcexit

FuncExit

if file opened
close file

return

-----------------

If you declare file handles, etc. as you need them, then the compiler will complain that the 'initialization' of the type was skipped by the goto.

In this case, the if statments would have only nested 5 levels deep ... ugh.
But in soeem of our more complex processing, there might be 15-20 function calls which might fail before the actual 'work' begins.

I WISH we were all OO - parts of this code base are untouched since the days of our company founders - back in 1989!



People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
GeneralRe: Difference between Typedef and #define? Pin
BadKarma10-Feb-06 4:38
BadKarma10-Feb-06 4:38 
GeneralRe: Difference between Typedef and #define? Pin
Blake Miller10-Feb-06 4:46
Blake Miller10-Feb-06 4:46 
GeneralRe: Difference between Typedef and #define? Pin
Ryan Binns10-Feb-06 11:53
Ryan Binns10-Feb-06 11:53 
QuestionMy string class Pin
Sarvan AL9-Feb-06 17:56
Sarvan AL9-Feb-06 17:56 
AnswerRe: My string class Pin
Bernhard9-Feb-06 19:57
Bernhard9-Feb-06 19:57 
AnswerRe: My string class Pin
Owner drawn9-Feb-06 21:22
Owner drawn9-Feb-06 21:22 
AnswerRe: My string class Pin
ThatsAlok10-Feb-06 0:06
ThatsAlok10-Feb-06 0:06 
QuestionWidescreen aspect ratio in openGL Pin
lastgen9-Feb-06 17:51
lastgen9-Feb-06 17:51 
AnswerRe: Widescreen aspect ratio in openGL Pin
lastgen12-Feb-06 2:01
lastgen12-Feb-06 2:01 
Questiondelete operator + Exception handling Pin
Sarvan AL9-Feb-06 17:45
Sarvan AL9-Feb-06 17:45 
AnswerRe: delete operator + Exception handling Pin
Owner drawn9-Feb-06 18:14
Owner drawn9-Feb-06 18:14 
GeneralRe: delete operator + Exception handling Pin
Stephen Hewitt9-Feb-06 21:13
Stephen Hewitt9-Feb-06 21:13 
GeneralRe: delete operator + Exception handling Pin
Owner drawn9-Feb-06 21:17
Owner drawn9-Feb-06 21:17 
AnswerRe: delete operator + Exception handling Pin
Bob Stanneveld9-Feb-06 23:38
Bob Stanneveld9-Feb-06 23:38 
Questionabout NI Graph usage in VC++ Pin
chethu6659-Feb-06 17:42
chethu6659-Feb-06 17:42 
AnswerRe: about NI Graph usage in VC++ Pin
ThatsAlok10-Feb-06 0:04
ThatsAlok10-Feb-06 0:04 
QuestionPorting problems from vc to vc.net pls. help Pin
arunperi9-Feb-06 16:52
arunperi9-Feb-06 16:52 

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.