Hello,
I'm going to change my C# style in programming(I've been using 'public static' for variables,methods - everything).
My question:
public class WinSock
{
public Socket sock;
public byte[] data;
.....
}
var data = new byte[2058];
data = WinSock.data;
or this one:
private class WinSock
{
private Socket sock;
private byte[] data;
.....
public byte[] getdata()
{
get {return data;}
}
}
WinSock ws = new WinSock();
var data = new byte[2058];
data = ws.getdata();
In both cases the data and sock variables can be accessed from other classes.
Which of the two declarations is better?