Link to home
Start Free TrialLog in
Avatar of CSecurity
CSecurityFlag for Iran, Islamic Republic of

asked on

Creating and initializing public variable

Hello!

Assume I have a code like this:

static void main() {

}

int test() {

}

I want to define a variable in this code which can be accessible from main and int.

Also if I define a variable for example X in main and another X in test, how can I call test's X from main?

Thanks
SOLUTION
Avatar of xRalf
xRalf

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CSecurity

ASKER

But I heard something like test::X or something like this
is it possible?
Avatar of rajeev_devin
rajeev_devin

>> is it possible?
No it is not possible
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial