"+=" operator, comments appreciated, thanks!

A

almurph

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.
 
B

Ben Bacarisse

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.
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.
 
K

Keith Thompson

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.
 
J

J. J. Farrell

Keith said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top