J
James Lapalme
Dear All,
This code should not compile and execute but is does ... why???
Here is the code ... I'm using Visual Studio .Net 2002
public struct Point{
public int x;
public int y;
}
public class App{
static Point p;
public static void Main(){
Point a = new Point();
a.x = 1;
a.y = 1;
a.Equals(p);
}
}
If I change the code to :
public class App{
public static void Main(){
Point p;
Point a = new Point();
a.x = 1;
a.y = 1;
a.Equals(p);
}
}
It does not compile any more because I'm using p without having initialized
it's members... but in the first code I did not initialized them either.
Thanks,
James Lapalme
This code should not compile and execute but is does ... why???
Here is the code ... I'm using Visual Studio .Net 2002
public struct Point{
public int x;
public int y;
}
public class App{
static Point p;
public static void Main(){
Point a = new Point();
a.x = 1;
a.y = 1;
a.Equals(p);
}
}
If I change the code to :
public class App{
public static void Main(){
Point p;
Point a = new Point();
a.x = 1;
a.y = 1;
a.Equals(p);
}
}
It does not compile any more because I'm using p without having initialized
it's members... but in the first code I did not initialized them either.
Thanks,
James Lapalme