Click here to Skip to main content
15,897,226 members
Home / Discussions / C#
   

C#

 
GeneralRe: Convert to C# code Pin
Steve McLenithan26-Jun-03 20:03
Steve McLenithan26-Jun-03 20:03 
GeneralRe: Convert to C# code Pin
J. Dunlap26-Jun-03 18:32
J. Dunlap26-Jun-03 18:32 
GeneralRe: Convert to C# code Pin
Steve McLenithan26-Jun-03 20:06
Steve McLenithan26-Jun-03 20:06 
GeneralRe: Convert to C# code Pin
leppie27-Jun-03 10:05
leppie27-Jun-03 10:05 
GeneralRe: Convert to C# code Pin
Steve McLenithan27-Jun-03 11:17
Steve McLenithan27-Jun-03 11:17 
GeneralRe: Convert to C# code Pin
Kant27-Jun-03 10:08
Kant27-Jun-03 10:08 
GeneralRe: Convert to C# code Pin
Steve McLenithan27-Jun-03 11:18
Steve McLenithan27-Jun-03 11:18 
GeneralOne code, two different results - C# vs C++ Pin
C. Augusto Proiete26-Jun-03 16:25
C. Augusto Proiete26-Jun-03 16:25 
As I was practicing my C# skills I came across the code below:
C#
int myFunc()
{
    int x;
    x = 42;
    x++;
    x += --x;
    return x;
}

What is the value returned from myFunc()?
As a C++ programmer I thought: "84 of course".

But when I compiled with C#, the function returns 85.
Just to confirm, I also compiled the same code with Java and returned 85 too.

Well... Can anyone explain this? :P
C. Augusto Proiete
https://augustoproiete.net


modified 25-May-20 21:50pm.

GeneralRe: One code, two different results - C# vs C++ Pin
Nick Seng26-Jun-03 16:49
Nick Seng26-Jun-03 16:49 
GeneralRe: One code, two different results - C# vs C++ Pin
leppie26-Jun-03 18:03
leppie26-Jun-03 18:03 
GeneralRe: One code, two different results - C# vs C++ Pin
Nick Seng26-Jun-03 18:13
Nick Seng26-Jun-03 18:13 
GeneralRe: One code, two different results - C# vs C++ Pin
jspano27-Jun-03 6:23
jspano27-Jun-03 6:23 
GeneralRe: One code, two different results - C# vs C++ Pin
C. Augusto Proiete27-Jun-03 15:23
C. Augusto Proiete27-Jun-03 15:23 
GeneralRe: One code, two different results - C# vs C++ Pin
jspano28-Jun-03 16:26
jspano28-Jun-03 16:26 
GeneralRe: One code, two different results - C# vs C++ Pin
Bo Hunter28-Jun-03 10:54
Bo Hunter28-Jun-03 10:54 
Questionusing Byte[] in a WebService method?? Pin
Uploader26-Jun-03 12:26
Uploader26-Jun-03 12:26 
AnswerRe: using Byte[] in a WebService method?? Pin
leppie26-Jun-03 15:12
leppie26-Jun-03 15:12 
GeneralRe: using Byte[] in a WebService method?? Pin
Uploader29-Jun-03 10:13
Uploader29-Jun-03 10:13 
QuestionWhat Other Options Beside System.Data.OleDb? Critical For Me, Please! Pin
Khang Nguyen26-Jun-03 11:55
Khang Nguyen26-Jun-03 11:55 
AnswerRe: What Other Options Beside System.Data.OleDb? Critical For Me, Please! Pin
Anonymous26-Jun-03 14:41
Anonymous26-Jun-03 14:41 
GeneralRe: What Other Options Beside System.Data.OleDb? Critical For Me, Please! Pin
Khang Nguyen27-Jun-03 4:57
Khang Nguyen27-Jun-03 4:57 
GeneralUsing framework version 1.1 Pin
monrobot1326-Jun-03 10:32
monrobot1326-Jun-03 10:32 
GeneralRe: Using framework version 1.1 Pin
Giles26-Jun-03 11:02
Giles26-Jun-03 11:02 
GeneralVolume control in C# Pin
ripsi26-Jun-03 10:17
ripsi26-Jun-03 10:17 
GeneralReading Password from Console Pin
Jarrett Vance26-Jun-03 9:08
Jarrett Vance26-Jun-03 9:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.