Skip to content

Identifier Scope

CD2 edited this page Feb 8, 2023 · 2 revisions

Global variables and member variables cannot be accessed as they are within a function.

int a = 1;

&C

{

int a = 2;

void f()

{

int a = 3;

int b = a; // local variable a

b = `a; // member variable a

b = .a; // global variable a

}

}

Clone this wiki locally