answersLogoWhite

0


Best Answer

It simply means one code block contains another code block. How you achieve this depends on the language, but in many languages we use opening and closing braces to define a code block.

function foo ()

{ // start of function block

{ // start of nested block

// ...

} // end of nested block

} // end of function block

Nested code blocks are typically used to define a new scope within an existing scope. Any variables declared within the nested block are local to the scope of that block and will fall from scope when we exit the nested block. This can be useful when we want to instantiate new variables within a larger scope but want to localise them to the code block that actually uses them. In some languages (such as C++) this also allows us to redefine names that were initially defined by the enclosing scope, temporarily hiding the original names from within the nested scope (only the local names are visible). When we exit the nested block, the original names become visible again. However, referring to two separate variables by the same name within two scopes of the same function can make code difficult to read, so this is best avoided.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is meant by the phrase one block of code can be nested in another?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What does the cowboy slang 'sell out' mean?

Cowboys loved a colorful phrase! This was another phrase that meant leaving quickly. The image is of someone selling everything and relocating.


What is meant by the phrase eberspacher?

Eberspacher is actually not a phrase. It is a German surname. The surname is another way for an individual to say "last name." The vernacular is used in many European countries.


What does the cowboy slang 'priminary' mean?

Cowboys loved a colorful phrase! This is another made-up word. It meant predicament or difficulty.


What does the cowboy slang 'absquatulate' mean?

Cowboys loved a colorful phrase! This was another made-up word. It meant to leave or disappear.


What is meant by the phrase soft tissue?

this


What is meant by the phrase trans ocean?

The phrase trans ocean is meant to mean across the ocean. Trans ocean is meant to be the same as transocean, which is not a word but a shorter version of transoceanic, to which it is meant to have a similar meaning.


What is meant by the phrase a wallpaper your desktop?

The phrase a wallpaper on your desktop can mean that your desktop is covered in papers. This can be meant on your computer or your actual desk.


What is a money summary format?

There is no information to be found specifically for the term money summary format. Perhaps The writer meant another term or phrase.


What does the cowboy slang 'slangander' mean?

Cowboys loved a colorful phrase! This meant to slander, or gossip and backbiting. It's another made-up word.


What is meant by the phrase a hard question?

The phrase means that the question is difficult to answer. Like this one.


What is meant by phrase you smell divine?

You smell heavenly or you smell very good :) Is this what you meant?


What does the cowboy slang 'stiver' mean?

Cowboys loved a colorful phrase! This one meant to run, to move off. It's another made-up word.