What is scope of a variable? (LOLZ)

Answers were Sorted based on User's Feedback



What is scope of a variable? (LOLZ)..

Answer / aboelella

Variable scope is the places in code where this variable can
be accessed

Varaible can be defined to be global (visible in the program
include scope)

Variable can be local if defined in the scope of parantesis
(inside function or in compound statement)

In classes variables scope depends on the way it is defined
(privat, public or protected)

Is This Answer Correct ?    21 Yes 0 No

What is scope of a variable? (LOLZ)..

Answer / lovly

One of the really big pluses with GOSUB/RETURN is that you
can share variables that are neither global nor restricted
to one piece of code.

With or without that functionality, how about a way to
share variables (with memory of course) between only
certain subs/functions? Something like:
(per function/sub)

"STATIC SHARED as integer namespace_name.variable_name =
0" -OR-
"STATIC SHARED namespace_name.variable_name as integer"

Usage would just be: "variable_name" -- no "." or namespace
prefix.

I think that would be a great addition to FB. Thoughts

Is This Answer Correct ?    2 Yes 5 No

Post New Answer

More C++ General Interview Questions

Explain the advantages of using friend classes.

0 Answers  


Find the second maximum in an array?

12 Answers   HCL,


What is a vector c++?

0 Answers  


What is class invariant?

1 Answers  


What is abstract class in c++?

0 Answers  






How many types of scopes are there in c++?

0 Answers  


Can member functions be private?

0 Answers  


What is array in c++ pdf?

0 Answers  


If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?

0 Answers  


How long does it take to get good at leetcode?

0 Answers  


What is do..while loops structure?

0 Answers  


What is the real purpose of class – to export data?

0 Answers  


Categories