On Dec 30, 2004, at 1:24 PM, Craig A. Finseth wrote:
Probably as either:
int getMyNum(int fnum, int snum)
{
int tnum;
tnum = fnum + snum;
return tnum;
}
or:
int getMyNum(int fnum, int snum)
{
return fnum + snum;
}
First, I apologize to everyone for forgetting the smily on my response.
Why? The first code snippet is perfectly legal. Isn't it?
Moreover, ill usage of = instead of == is a famous error in
C/C++ coding ;-)
I'm not a C/C++ coder, but I am interested in this thread, and don't
see the problem here.
I though == referred to equality testing, and so the famous error is in
using = when a comparison was intended, causing an assignment. I don't
see that in the above code snippets.
What I do see is the use of a locally scoped integer that isn't really
necessary.
What am I not seeing?
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|