Return or Not?
From: Rich (Someone_at_somewhere.com)
Date: 11/18/04
- Next message: Marko Zagar: "Re: Return or Not?"
- Previous message: JS: "How to compile this C Code in Dev-C++??"
- Next in thread: Marko Zagar: "Re: Return or Not?"
- Reply: Marko Zagar: "Re: Return or Not?"
- Reply: Aggro: "Re: Return or Not?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 18 Nov 2004 17:24:39 +0000 (UTC)
Hello,
I am still learning C++, and have been reading a couple of books on the
subject, and have learnt a fair bit I feel:)
Now the confusing part, the two books contradict each other in terms of
functions.
One says that it is ok not to return a value, and precede the function
with void, and the other says that a function should always return a
value no matter what, and to always return 0 for success or no zero for
error codes.
The way I see it, I don't see anything wrong with either way, perhaps a
minuscule performance hit on the version that always returns a value.
I was determined when I started to learn C++ that I would at least try
and do it as correctly as possible as I have heard about all the
headaches that can happen due to not doing it properly the first time
around.
Can anyone please tell me whether it is ok to use either method, or if I
should avoid one of them.
Thanks
- Next message: Marko Zagar: "Re: Return or Not?"
- Previous message: JS: "How to compile this C Code in Dev-C++??"
- Next in thread: Marko Zagar: "Re: Return or Not?"
- Reply: Marko Zagar: "Re: Return or Not?"
- Reply: Aggro: "Re: Return or Not?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|