Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9062799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:49:46+00:00 2026-06-16T15:49:46+00:00

Possible Duplicate: Scope with Brackets in C++ I’m dealing with v8 javascript engine, developing

  • 0

Possible Duplicate:
Scope with Brackets in C++

I’m dealing with v8 javascript engine, developing a learning enviroment for new students in my university, and i step up with this:

d8.cc:309

char* input = NULL;
{  // Release lock for blocking input.
  Unlocker unlock(isolate);
  input = fgets(buffer, kBufferSize, stdin);
}
  1. What’s its name?
  2. How can I use it in other contexts?
  3. Is only fair in c++?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T15:49:48+00:00Added an answer on June 16, 2026 at 3:49 pm

    The overall structure (i.e. an unnamed block) is known as a compound-statement as far as the language standard is concerned. It serves to introduce a new scope.

    In C++, there are generally two uses for this:

    1. To limit a local variable to a particular section of code; the aim being to minimise scope “pollution”, and to make it easier for the reader of the code. (The same can be achieved in other languages, like C and Java.)

    2. Tightly controlling the lifetime of an object/resource, because the destructor of scope-local variables will be automatically called at the end of the scope. This can be used for several clever things, e.g. automatically closing file handles, releasing mutexes, and so on. So you may hear people talk about e.g. scoped mutexes. (C and Java don’t have destructors, so this concept doesn’t translate.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: JavaScript Variable Scope I am (obviously) pretty new to Javascript, and I've
Possible Duplicate: How can I access local scope dynamically in javascript? Hi all. We
Possible Duplicate: Variable scope in Javascript for loop for(i=0;i<4;i++){ } Do I need to
Possible Duplicate: Javascript outer scope variable access I have a javascript module that looks
Possible Duplicate: Javascript closure inside loops - simple practical example javascript variable scope/closure in
Possible Duplicate: JavaScript Variable Scope I have a JavaScript function for HTML select options
Possible Duplicate: JavaScript closures and variable scope Assign click handlers in for loop I
Possible Duplicate: Confused by Javascript's variable scope For example, this is my JavaScript code:
Possible Duplicate: JavaScript scope and closure What is this for? (function(){ //The code to
Possible Duplicate: JavaScript Variable Scope var flag = false; if(flag === true) { var

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.