<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged scope</title>
<link>https://coderlegion.com/tag/scope</link>
<description>Powered by Question2Answer</description>
<item>
<title>Was not declared in this scope c++</title>
<link>https://coderlegion.com/24887/was-not-declared-in-this-scope-c</link>
<description>&lt;p&gt;
&lt;strong&gt;&lt;span style=&quot;color: #ff04fc;&quot;&gt;&quot;was not declared in this scope&quot;&lt;/span&gt; is a common error message encountered when programming in C++. This error occurs when a variable or function is used before it has been declared or defined in the current scope. Understanding the scope of variables and functions is crucial for writing correct and efficient C++ code. In this article, we will dive into the world of scope in C++ and explore the different types of scope available, including global, local, function-level, class-level and namespace-level. We will also provide examples and explanations to help you understand the concept better and put it into practice. So whether you're a beginner or an experienced developer, this article will help you master the art of scope in C++.
&lt;/strong&gt;
&lt;/p&gt;&lt;hr&gt;
&lt;div id=&quot;toc-div&quot;&gt;
&lt;h3&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;&lt;strong&gt; Table of Contents:&lt;a id=&quot;toc-toogle&quot; class=&quot;open&quot;&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;div id=&quot;toc-list&quot;&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#understanding-scope-in-c++&quot;&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;Understanding scope in C++&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#why-the-error-&quot;&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;Why the error &quot;was not declared in this scope&quot;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#how-to-fix-the-error&quot;&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;How to fix the error&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#conclusion&quot;&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;Conclusion&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#references&quot;&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;References&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h3&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;Understanding scope in C++&lt;/span&gt;&lt;a id=&quot;understanding-scope-in-c++&quot; class=&quot;custom_anchor&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In the world of programming, scope is a fundamental concept that every developer must understand. It defines the boundaries of where a variable or function can be used within a program, and can greatly impact the readability and maintainability of your code.&lt;/p&gt;
&lt;p&gt;Scope in C++ refers to the region of a program in which a particular variable, function, or object is visible or accessible. In other words, it defines the boundaries of where a variable or function can be used within a program.&lt;/p&gt;
&lt;p&gt;There are two types of scope in C++: global and local.&lt;/p&gt;
&lt;p&gt;A &lt;span style=&quot;color: #ff04fc;&quot;&gt;global variable&lt;/span&gt; or function is one that is defined outside of any function or block. It can be accessed from anywhere within the program, including within functions and other blocks. For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;
int x = 5; // global variable

void printX() {
cout &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A &lt;span style=&quot;color: #ff04fc;&quot;&gt;local variable&lt;/span&gt; or function, on the other hand, is one that is defined within a function or block. It can only be accessed within the function or block in which it is defined, and not outside of it. For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;
void printX() {
int x = 5; // local variable
cout &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When a local variable and global variable have the same name, the local variable takes precedence within the function or block in which it is defined. For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;
int x = 10; // global variable
void printX() {
int x = 5; // local variable
cout &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;C++ also has function-level scope, which is similar to local scope, but applies to variables and functions defined within a function. For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;
int main() {
int x = 5; // local variable
{
int x = 10; // nested local variable
cout &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example, the nested local variable &lt;span style=&quot;color: #ff04fc;&quot;&gt;&lt;code&gt;x&lt;/code&gt;&lt;/span&gt; takes precedence over the outer local variable &lt;span style=&quot;color: #ff04fc;&quot;&gt;&lt;code&gt;x&lt;/code&gt;&lt;/span&gt; within the nested block. Once the block is exited, the outer local variable &lt;span style=&quot;color: #ff04fc;&quot;&gt;&lt;code&gt;x&lt;/code&gt;&lt;/span&gt; becomes visible and accessible again.&lt;/p&gt;
&lt;div class=&quot;div-faq&quot;&gt;
&lt;span class=&quot;faq-header&quot;&gt;Why scope is important?&lt;/span&gt;
&lt;span class=&quot;faq-body&quot;&gt;
The idea of scope is important because it helps to keep track of variables and functions and ensures that the correct one is being used in the correct context. It also helps to reduce naming conflicts and make the code more readable.&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;In addition to that, C++ also has class-level and namespace-level scope.&lt;br&gt;
Class-level scope applies to variables and functions defined within a class. They can only be accessed by object of that class or by a friend function/class.&lt;br&gt;
A namespace is a container for a set of identifiers, you can define variables, functions, classes and other types inside a namespace. They can be accessed by using the scope resolution operator (::)&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;
namespace MyNamespace {
int x = 5;
}

int main() {
cout &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is important to note that, when you define a variable or function with the same name in different namespaces, you can use the scope resolution operator to specify which one you want to use.&lt;/p&gt;
&lt;h3&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;Why the error &quot;was not declared in this scope&quot;&lt;/span&gt;&lt;a id=&quot;why-the-error-&quot; class=&quot;custom_anchor&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;When a variable or function is used before it has been declared or defined, the compiler generates an error message indicating that the variable or function &lt;span style=&quot;color: #ff04fc;&quot;&gt;&quot;was not declared in this scope&quot;&lt;/span&gt;. This can happen in several ways:&lt;/p&gt;
&lt;p&gt;Using a variable before it has been declared:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;
#include 

int main() {
std::cout &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using a variable from a different scope:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;
#include 

int x = 0;

int main() {
{
int x = 1;
std::cout &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using a function before it has been declared or defined:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;
#include 

int main() {
std::cout &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Another common cause of this error is when a variable or function is misspelled. This can happen if the programmer mistypes the name of a variable or function or if the case of the letters is not correct. For example, if a variable is declared as &lt;span style=&quot;color: #ff04fc;&quot;&gt;&lt;code&gt;myVariable&lt;/code&gt;&lt;/span&gt; but is later referred to as &lt;span style=&quot;color: #ff04fc;&quot;&gt;&lt;code&gt;myvariable&lt;/code&gt;&lt;/span&gt;, this will result in a &lt;span style=&quot;color: #ff04fc;&quot;&gt;&quot;was not declared in this scope&quot;&lt;/span&gt; error.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;
#include 

int main() {
int myVariable;

std::cout &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;How to fix the error&lt;/span&gt;&lt;a id=&quot;how-to-fix-the-error&quot; class=&quot;custom_anchor&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To fix this error, we need to ensure that the variable or function is declared or defined before it is used. This can be done by:&lt;/p&gt;
&lt;p&gt;Declaring the variable before it is used:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;
#include 

int main() {
int x;
std::cout &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using the variable or function from the correct scope:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;
#include 

int x = 0;

int main() {
{
int x = 1;
std::cout &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Declaring the function before it is used:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;
#include 

int foo(){return 1;}

int main() {
std::cout &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;div-green&quot;&gt;
&lt;span class=&quot;alert-header&quot;&gt;Tip&lt;/span&gt;
&lt;span class=&quot;alert-body&quot;&gt;It is important to keep in mind that variables have a scope and that scope determines where the variable can be accessed from. Also, function should be declared before they are called. The error message &lt;span style=&quot;color: #ff04fc;&quot;&gt;&quot;was not declared in this scope&quot;&lt;/span&gt; is a reminder of these important concepts in C++ programming.&lt;/span&gt;
&lt;/div&gt;
&lt;h3&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;Conclusion&lt;/span&gt;&lt;a id=&quot;conclusion&quot; class=&quot;custom_anchor&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In conclusion, &lt;span style=&quot;color: #ff04fc;&quot;&gt;&quot;was not declared in this scope&quot;&lt;/span&gt; error can occur due to a variety of reasons such as variable or function being used before it has been declared or defined, it being in the wrong scope or not being spelled correctly. It is important to pay attention to the variables and functions that are being used in the code, and to make sure that they have been declared and defined before they are used.&lt;/p&gt;
&lt;h3&gt;&lt;span style=&quot;font-family:arial,helvetica,sans-serif;&quot;&gt;References&lt;/span&gt;&lt;a id=&quot;references&quot; class=&quot;custom_anchor&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;Stroustrup, B. (2013). The C++ Programming Language (4th ed.). Addison-Wesley Professional.&lt;/li&gt;&lt;li&gt;Deitel, P. J., &amp;amp; Deitel, H. M. (2015). C++ How to Program (10th ed.). Pearson Education.&lt;/li&gt;&lt;li&gt;Lippman, S. B., Lajoie, J., &amp;amp; Moo, B. E. (2012). C++ Primer (5th ed.). Addison-Wesley Professional.&lt;/li&gt;&lt;/ul&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/24887/was-not-declared-in-this-scope-c</guid>
<pubDate>Wed, 19 Aug 2026 05:46:58 +0000</pubDate>
</item>
<item>
<title>How Long Does It Take to Build a Custom Website? 2026 Timeline</title>
<link>https://coderlegion.com/21100/how-long-does-it-take-to-build-a-custom-website-2026-timeline</link>
<description>
&lt;h1&gt;How Long Does It Take to Build a Custom Website? A 2026 Timeline From the Workshop&lt;/h1&gt;
&lt;p class=&quot;post-byline&quot;&gt;
    &lt;span&gt;&amp;#9201;&amp;#65039; Project Timeline&lt;/span&gt; &amp;middot;     Updated June 2026     &amp;middot; 10 min read    &amp;middot; by Jacob Campbell
&lt;/p&gt;

&lt;p class=&quot;article-intro&quot;&gt;&lt;/p&gt;&lt;p&gt;I'm Jacob Campbell, and after delivering custom sites for years I can tell you the honest answer to &quot;how long does a website take?&quot; up front: a focused custom business site is usually ready in about a month, while ecommerce and web apps take longer because there's more to build and test. But here's the part most timelines hide &amp;mdash; the single biggest variable isn't the developer's speed, it's how quickly &lt;em&gt;content and decisions&lt;/em&gt; arrive from your side. I've had a build sit finished for three weeks waiting on a logo. This guide gives you a realistic 2026 timeline for each project type, a phase-by-phase look at where the days actually go, what slows a build down, and exactly how to launch faster without sacrificing quality.&lt;/p&gt;

&lt;h2&gt;Key facts&lt;/h2&gt;
&lt;div class=&quot;post-stats&quot;&gt;
        &lt;div class=&quot;post-stat&quot;&gt;&lt;div class=&quot;v&quot;&gt;~1 month&lt;/div&gt;&lt;div class=&quot;l&quot;&gt;Custom business website&lt;/div&gt;&lt;/div&gt;
        &lt;div class=&quot;post-stat&quot;&gt;&lt;div class=&quot;v&quot;&gt;4&amp;ndash;8 weeks&lt;/div&gt;&lt;div class=&quot;l&quot;&gt;Custom ecommerce store&lt;/div&gt;&lt;/div&gt;
        &lt;div class=&quot;post-stat&quot;&gt;&lt;div class=&quot;v&quot;&gt;8&amp;ndash;12+ weeks&lt;/div&gt;&lt;div class=&quot;l&quot;&gt;SaaS / web application&lt;/div&gt;&lt;/div&gt;
        &lt;div class=&quot;post-stat&quot;&gt;&lt;div class=&quot;v&quot;&gt;Day 1&lt;/div&gt;&lt;div class=&quot;l&quot;&gt;Scope &amp;amp; timeline locked&lt;/div&gt;&lt;/div&gt;
    &lt;/div&gt;

&lt;h2&gt;The headline numbers&lt;/h2&gt;
&lt;p&gt;A professional custom business website typically takes &lt;strong&gt;about one month&lt;/strong&gt; from kickoff to launch. A custom ecommerce store usually runs &lt;strong&gt;four to eight weeks&lt;/strong&gt;, and a SaaS or web application is &lt;strong&gt;eight to twelve weeks or more&lt;/strong&gt;, depending on feature depth. These ranges assume content and feedback arrive on schedule. The coding itself is rarely the bottleneck &amp;mdash; in my projects the build phase is the most predictable part; the wait time lives almost entirely on the client side.&lt;/p&gt;&lt;h2&gt;A realistic timeline, phase by phase&lt;/h2&gt;
&lt;p&gt;A typical custom build moves through five phases. &lt;strong&gt;Discovery and scope&lt;/strong&gt; (a few days) locks exactly what's being built. &lt;strong&gt;Design and layout&lt;/strong&gt; (about a week) produces the templates. &lt;strong&gt;Development&lt;/strong&gt; (one to three weeks) is where the hand-coding happens. &lt;strong&gt;Content, SEO, and testing&lt;/strong&gt; (a few days) covers schema, Core Web Vitals tuning, and cross-device QA. Then &lt;strong&gt;deployment and launch&lt;/strong&gt;. Because the code is written rather than assembled from plugins, the testing phase stays short &amp;mdash; there are no theme conflicts or plugin incompatibilities to chase down at the end.&lt;/p&gt;&lt;h2&gt;What actually slows a build down&lt;/h2&gt;
&lt;p&gt;I track the cause of every delay, and the pattern never changes. The top four are: slow content delivery (copy, images, logos), late or shifting decisions, scope that wasn't pinned down at the start, and waiting on third-party access &amp;mdash; a domain registrar login, a payment account, a CRM API key. Notice that none of these are coding problems. They're planning problems, and every one of them is avoidable with a clear brief and prepared assets before development begins.&lt;/p&gt;&lt;h2&gt;How to launch your website faster&lt;/h2&gt;
&lt;p&gt;If you want speed, do four things before development starts: &lt;strong&gt;lock the scope&lt;/strong&gt; so there's no mid-build redesign; &lt;strong&gt;gather your content and brand assets&lt;/strong&gt; (final copy, high-res images, logo files, brand colours); &lt;strong&gt;name one decision-maker&lt;/strong&gt; for sign-off so feedback doesn't arrive by committee; and &lt;strong&gt;prepare domain and payment access&lt;/strong&gt; in advance. Clients who do this consistently launch on the early end of every range &amp;mdash; and a flat-fee scope removes the change-order back-and-forth that stretches most projects elsewhere.&lt;/p&gt;&lt;h2&gt;Why custom code doesn't mean slower delivery&lt;/h2&gt;
&lt;p&gt;People assume hand-coding takes longer than a template. For a quality result, the opposite is usually true. With a template you spend the project fighting the theme, stripping out bloat you didn't ask for, and patching plugins to behave. Custom code is built to spec the first time, so the effort goes into &lt;em&gt;your&lt;/em&gt; requirements rather than undoing someone else's defaults. The result is a lighter, faster, Lighthouse-100 site delivered on a more predictable schedule &amp;mdash; which is exactly why I don't treat &quot;fast&quot; and &quot;custom&quot; as a trade-off.&lt;/p&gt;&lt;h2&gt;Sources &amp;amp; further reading&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://web.dev/articles/vitals&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow&quot;&gt;web.dev &amp;mdash; Core Web Vitals (the metrics tuned in the testing phase)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;/blog/how-much-does-a-custom-website-cost&quot;&gt;BuiltToWinWeb &amp;mdash; What a custom website costs&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Timeline ranges reflect my own delivery windows across business, ecommerce, and SaaS projects as of June 2026.&lt;/p&gt;
&lt;h2&gt;Related services&lt;/h2&gt;
&lt;div class=&quot;post-related&quot;&gt;
        &lt;a href=&quot;/free-quote/&quot;&gt;
        &lt;div class=&quot;t&quot;&gt;Get your project timeline&lt;/div&gt;
        &lt;div class=&quot;d&quot;&gt;Tell us your scope and receive a flat-fee quote and delivery window within 24 hours.&lt;/div&gt;
    &lt;/a&gt;
        &lt;a href=&quot;/services/custom-PHP-website&quot;&gt;
        &lt;div class=&quot;t&quot;&gt;Custom website packages&lt;/div&gt;
        &lt;div class=&quot;d&quot;&gt;See what is included in each flat-fee build, start to launch.&lt;/div&gt;
    &lt;/a&gt;
        &lt;a href=&quot;/blog/how-much-does-a-custom-website-cost&quot;&gt;
        &lt;div class=&quot;t&quot;&gt;What a custom website costs&lt;/div&gt;
        &lt;div class=&quot;d&quot;&gt;Pricing for business, ecommerce, and SaaS projects.&lt;/div&gt;
    &lt;/a&gt;
    &lt;/div&gt;

&lt;h2&gt;Frequently asked questions&lt;/h2&gt;
&lt;h3&gt;How long does it take to build a custom website?&lt;/h3&gt;
&lt;p&gt;A custom business website is usually delivered in about one month. Ecommerce stores take roughly four to eight weeks and SaaS or web applications take eight to twelve weeks or more, depending on features and how quickly content is provided.&lt;/p&gt;
&lt;h3&gt;Can a website be built faster than a month?&lt;/h3&gt;
&lt;p&gt;Yes. Smaller sites with ready content and a locked scope can launch in two to three weeks. The fastest projects are the ones where content, branding, and decisions are prepared before development begins.&lt;/p&gt;
&lt;h3&gt;What slows down a website project?&lt;/h3&gt;
&lt;p&gt;The biggest delays are late content, shifting requirements, unclear scope, and waiting on domain or payment access. Coding is rarely the bottleneck &amp;mdash; planning and content usually are.&lt;/p&gt;
&lt;h3&gt;Does a custom site take longer than a template?&lt;/h3&gt;
&lt;p&gt;Not necessarily. A custom build is coded to spec once, while templates often require removing bloat and patching plugins. A quality custom site is frequently delivered on a more predictable timeline than a heavily customised template.&lt;/p&gt;
&lt;h3&gt;How can I make my website launch faster?&lt;/h3&gt;
&lt;p&gt;Lock your scope early, gather content and brand assets up front, assign one decision-maker, and prepare domain and payment access in advance. A clear flat-fee scope removes the back-and-forth that stretches most projects.&lt;/p&gt;

&lt;div class=&quot;post-cta&quot;&gt;
    &lt;h2&gt;Get a clear timeline for your website&lt;/h2&gt;
    &lt;p&gt;Tell us what you need and receive a flat-fee quote with a defined delivery window within 24 hours &amp;mdash; no monthly fees, no pressure.&lt;/p&gt;
    &lt;a class=&quot;btn&quot; href=&quot;/free-quote/&quot;&gt;Get my free quote&lt;/a&gt;
&lt;/div&gt;
</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/21100/how-long-does-it-take-to-build-a-custom-website-2026-timeline</guid>
<pubDate>Mon, 29 Jun 2026 07:45:45 +0000</pubDate>
</item>
</channel>
</rss>