Question on class programming

if the following structure…

class a {
var c
class b {}
}

…how can class b change variable c? or is there a better way to implement this?