0
What is private and public in c++?
What is private and public in c++? in c++ we'll use the term private and public and in Python we'll use global variable and local variable so are they both same?
4 Respuestas
+ 1
Global means every scope can access it. local means only the scope where it's declared can access it.
global and local aren't the same as public and private because public and private only applies to classes or structs while global and local are for functions and variables. Other than that, they're pretty similar.
+ 1
private means only the class scope can access it. public means you can access it in any scope (if you have an instance of it).
+ 1
A block of code. a scope is surrounded between curly brackets (in C++).
0
what do u mean by scope?