realbasic-nug
[Top] [All Lists]

Re: C++ Libraries for RB (A little bit off)

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: C++ Libraries for RB (A little bit off)
From: Stuart Malin <stuart at zhameesha dot com>
Date: Thu, 30 Dec 2004 14:26:57 -0800
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <1906DF0E-5A9E-11D9-AB40-000A9578809A at epicodeinteractive dot com> <8FA065D8-5A9E-11D9-8A9B-000393101B4A at mobleybros dot com> <DCB0C160-5AA2-11D9-B1D0-000A95A0549A at comcast dot net> <20041230204517 dot 4DC7F76C69 at isis dot visi dot com> <722D5284-5AA6-11D9-863A-000A9585ABA2 at mac dot com> <20041230212422 dot E126876C69 at isis dot visi dot com>

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>

<Prev in Thread] Current Thread [Next in Thread>