So i'm trying to access one static string from classA to classB using:
public class classB
{
classA ca = new classA();
//This is the value that i want from class B
//Here it pops the following Error:
string B = ca.A;
}
In the real code i need the variable from classA as static because it changes the value after i run a internal method.
if string A in classA is declared as public static Error: ClassA.A cannot be accessed with an instance reference; qualify it with a type name instead If string A in classA is declared just as static Error:ClassA.A is inaccessible due to its protection level.
public class classA
{
static string A = "Hi";
}