is this a boxing or precedence problem?
philipl_at_vistatec.ie
Date: 02/20/04
- Next message: Jof: "Nested classes"
- Previous message: Simon Jefferies: "Form properties are missing"
- Next in thread: n!: "Re: is this a boxing or precedence problem?"
- Reply: n!: "Re: is this a boxing or precedence problem?"
- Messages sorted by: [ date ] [ thread ]
Date: 20 Feb 2004 04:07:25 -0800
hello, with the below code, i have been trying to figure for a while
whats causing this problem. Is this a problem or feature??
i know that j is incremented below with any temp variables but i uses
a temp var. why is i printed as 0? Is it because the one in the heap
is being referenced? If so why is this, as i thought values types are
kept in the stack?
thx for expertise.
int i=0;
int j=0;
public box()
{
Console.WriteLine(++j); //this will print j as 1
Console.WriteLine(i++); //this will print i as 0
}
- Next message: Jof: "Nested classes"
- Previous message: Simon Jefferies: "Form properties are missing"
- Next in thread: n!: "Re: is this a boxing or precedence problem?"
- Reply: n!: "Re: is this a boxing or precedence problem?"
- Messages sorted by: [ date ] [ thread ]