G
Guest
Hi there,
I had seen examples for classes, but i had no idea how to implement the same
thing in struct. I am quite mix up!
Which one is correct?
Scenario:
WForm.cs - the one that calls FileA.cs to access the structures
FileA.cs - contains all structures
1)
public struct TestA
{
public byte a;
public byte b;
public struct TestB
{
public byte c;
public byte d;
}
}
yes/no - but i think this is not recommended, i read it somewhere.. not
secure or something
2)
public struct TestA
{
internal byte a;
internal byte b;
public struct TestB
{
internal byte c;
internal byte d;
}
}
yes/no?
3)
public struct TestA
{
internal byte a;
internal byte b;
internal struct TestB
{
internal byte c;
internal byte d;
}
}
yes/no
4)
internal struct TestA
{
public byte a;
public byte b;
public struct TestB
{
public byte c;
public byte d;
}
}
yes/no
5)
internal struct TestA
{
public byte a;
public byte b;
internal struct TestB
{
public byte c;
public byte d;
}
}
yes/no
6)
public struct TestA
{
private byte a;
private byte b;
public struct TestB
{
private byte c;
private byte d;
}
}
yes/no - but how could this is possible? Is there a way to get out the
private values
7)
public struct TestA
{
private byte a;
private byte b;
private struct TestB
{
private byte c;
private byte d;
}
}
yes/no
8)
private struct TestA
{
public byte a;
public byte b;
private struct TestB
{
public byte c;
public byte d;
}
}
yes/no
Any idea please? Can anyone clear my doubts? Thanks.
I had seen examples for classes, but i had no idea how to implement the same
thing in struct. I am quite mix up!
Which one is correct?
Scenario:
WForm.cs - the one that calls FileA.cs to access the structures
FileA.cs - contains all structures
1)
public struct TestA
{
public byte a;
public byte b;
public struct TestB
{
public byte c;
public byte d;
}
}
yes/no - but i think this is not recommended, i read it somewhere.. not
secure or something
2)
public struct TestA
{
internal byte a;
internal byte b;
public struct TestB
{
internal byte c;
internal byte d;
}
}
yes/no?
3)
public struct TestA
{
internal byte a;
internal byte b;
internal struct TestB
{
internal byte c;
internal byte d;
}
}
yes/no
4)
internal struct TestA
{
public byte a;
public byte b;
public struct TestB
{
public byte c;
public byte d;
}
}
yes/no
5)
internal struct TestA
{
public byte a;
public byte b;
internal struct TestB
{
public byte c;
public byte d;
}
}
yes/no
6)
public struct TestA
{
private byte a;
private byte b;
public struct TestB
{
private byte c;
private byte d;
}
}
yes/no - but how could this is possible? Is there a way to get out the
private values
7)
public struct TestA
{
private byte a;
private byte b;
private struct TestB
{
private byte c;
private byte d;
}
}
yes/no
8)
private struct TestA
{
public byte a;
public byte b;
private struct TestB
{
public byte c;
public byte d;
}
}
yes/no
Any idea please? Can anyone clear my doubts? Thanks.