"+=" operator, comments appreciated, thanks!

Discussion in 'C Programming' started by almurph@altavista.com, Mar 14, 2009.

  1. Guest

    Hi,

    Just wondering is a difference between the "+=" operator between C
    and C#?


    I ask as I have reverse engineered some C code to C# and am receiving
    some differing results. I have traced it down to a line involving a
    "+=" operator. The C clode uses floats but I am using double, but this
    should not make a difference right?

    Just wondering if anyone has any comments or suggestions or user
    experiences that thay would like to share.

    Thanks,
    Al.
     
    , Mar 14, 2009
    #1
    1. Advertising

  2. "Malcolm McLean" <> writes:

    > <> wrote in message news:
    >> Just wondering is a difference between the "+=" operator between C
    >> and C#?
    >>
    >>
    >> I ask as I have reverse engineered some C code to C# and am receiving
    >> some differing results. I have traced it down to a line involving a
    >> "+=" operator. The C clode uses floats but I am using double, but this
    >> should not make a difference right?


    You happen to have a case where I would have thought there would not be
    much difference, but you really need to ask in a C# group. When you
    do (or if you post similar questions here) it really helps to have
    actual code (especially including the types of the various objects)
    and what you see as going wrong.

    >> Just wondering if anyone has any comments or suggestions or user
    >> experiences that thay would like to share.
    >>

    > C# += means the same as C +=.


    I don't think so. Even with the simplest arithmetic types for x and
    y, x += y does not mean the same in the two languages (but I am not an
    expert in C#). Of course, if x and y are not plain types the effect
    is wildly different.

    --
    Ben.
     
    Ben Bacarisse, Mar 14, 2009
    #2
    1. Advertising

  3. "" <> writes:
    > Just wondering is a difference between the "+=" operator between C
    > and C#?


    No idea. Why would you ask a C# question in a C newsgroup?

    If you have specific questions about C's "+=" operator, this is the
    place to ask. If you want to know how C's "+=" operator works in
    general, a good C reference or the C standard would be better. If you
    want to know something about C#, you're in the wrong place.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Mar 14, 2009
    #3
  4. Keith Thompson wrote:
    > "" <> writes:
    >> Just wondering is a difference between the "+=" operator between C
    >> and C#?

    >
    > No idea. Why would you ask a C# question in a C newsgroup?


    For the same reason that he would ask a C question in a C# group.

    It isn't a "C#" question, it's a "C and C#" question. This isn't the
    ideal place for it, but nor is a C# group.

    Some have suggested that he's more likely to find people who know both C
    and C# in a C# group than a C group; I don't know if that's true, but
    from evidence to date there don't seem to be many here who know both.
     
    J. J. Farrell, Mar 14, 2009
    #4
  5. CBFalconer Guest

    "" wrote:
    >
    > Just wondering is a difference between the "+=" operator between C
    > and C#?


    We have no idea. This is c.l.c, and we discuss the C langage. C#
    is something else.

    --
    [mail]: Chuck F (cbfalconer at maineline dot net)
    [page]: <http://cbfalconer.home.att.net>
    Try the download section.
     
    CBFalconer, Mar 15, 2009
    #5
  6. In article <ZZXul.261$>,
    Golden California Girls <> wrote:
    >CBFalconer wrote:
    >> "" wrote:
    >>> Just wondering is a difference between the "+=" operator between C
    >>> and C#?

    >>
    >> We have no idea. This is c.l.c, and we discuss the C langage. C#
    >> is something else.

    >
    >CBF is not authorized to speak for me.


    These days, I don't think CBF is authorized to speak for CBF.
     
    Kenny McCormack, Mar 15, 2009
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brad Jones

    Help or comments appreciated.

    Brad Jones, May 18, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    1,241
    Brad Jones \(not CodeGuru Guy!\)
    May 19, 2005
  2. Replies:
    3
    Views:
    412
    Roedy Green
    Sep 22, 2005
  3. Deryck
    Replies:
    7
    Views:
    480
  4. windandwaves
    Replies:
    18
    Views:
    702
    Spartanicus
    Mar 19, 2005
  5. planetthoughtful
    Replies:
    6
    Views:
    385
    Kent Johnson
    Dec 14, 2005
Loading...

Share This Page