<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Bello Osagie</title>
    <description>The latest articles on DEV Community by Bello Osagie (@bello).</description>
    <link>https://dev.to/bello</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F428113%2F28db81d1-ebf9-4a3f-bde5-f59d49aed356.jpg</url>
      <title>DEV Community: Bello Osagie</title>
      <link>https://dev.to/bello</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bello"/>
    <language>en</language>
    <item>
      <title>Fast &amp; Clean TypeScript Workflow with Environment Variables, Bun, and ts-node-dev</title>
      <dc:creator>Bello Osagie</dc:creator>
      <pubDate>Fri, 18 Jul 2025 21:38:09 +0000</pubDate>
      <link>https://dev.to/bello/fast-clean-typescript-workflow-with-environment-variables-bun-and-ts-node-dev-1g14</link>
      <guid>https://dev.to/bello/fast-clean-typescript-workflow-with-environment-variables-bun-and-ts-node-dev-1g14</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/PkwM39Vn6_0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Here's how to bootstrap and evolve your Express‑style TypeScript app step by step:&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Project Initialization
&lt;/h2&gt;

&lt;p&gt;Initialize your project and TypeScript entry point:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm init &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;mkdir &lt;/span&gt;src
&lt;span class="nb"&gt;touch &lt;/span&gt;src/app.ts .env.local .gitignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your &lt;code&gt;package.json&lt;/code&gt; now has defaults, and you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;src/app.ts&lt;/code&gt; – your app entry&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.env.local&lt;/code&gt; – development env file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.gitignore&lt;/code&gt; – to protect sensitive files&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Environment Variables in &lt;code&gt;.env.local&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="c"&gt;# .env.local
&lt;/span&gt;&lt;span class="py"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;5000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This file sets &lt;code&gt;PORT=5000&lt;/code&gt; for development, allowing differentiation from production.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. TypeScript &amp;amp; &lt;code&gt;@types/node&lt;/code&gt; Setup
&lt;/h2&gt;

&lt;p&gt;Install type definitions for Node.js to fix lint issues like &lt;code&gt;process.env.PORT&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-D&lt;/span&gt; @types/node
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;@types/node&lt;/code&gt; provides TypeScript types for built-in Node APIs, improving IDE feedback.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Reading Env &amp;amp; Demo Outputs
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/app.ts&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PORT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`PORT is &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// undefined w/o loading env file&lt;/span&gt;

&lt;span class="kr"&gt;enum&lt;/span&gt; &lt;span class="nx"&gt;MyEnum&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;A&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;B&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;MyEnum&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;A&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Type stripping demo with Node&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;calcSum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;calc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;calcSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`The sum is &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;With &lt;code&gt;node src/app.ts&lt;/code&gt;, &lt;code&gt;.env.local&lt;/code&gt; is &lt;strong&gt;not loaded&lt;/strong&gt;, so &lt;code&gt;PORT&lt;/code&gt; is &lt;code&gt;undefined&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Node &lt;strong&gt;runs TS&lt;/strong&gt; by stripping type annotations, even if types mismatch—it doesn't type-check at runtime.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. Scripts &amp;amp; Loading &lt;code&gt;.env.local&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;In &lt;code&gt;package.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json-doc"&gt;&lt;code&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"node --env-file=.env.local src/app.ts"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;npm run dev&lt;/code&gt; now loads &lt;code&gt;.env.local&lt;/code&gt;, so &lt;code&gt;PORT&lt;/code&gt; logs &lt;code&gt;5000&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;For production, switch to &lt;code&gt;.env&lt;/code&gt; with &lt;code&gt;"start": "node --env-file=.env src/app.js"&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  6. Safe &lt;code&gt;.gitignore&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.env
.env.local
node_modules
dist
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This prevents secrets and build artifacts from leaking to GitHub, and &lt;code&gt;node_modules&lt;/code&gt; is rebuilt via &lt;code&gt;npm install&lt;/code&gt;, avoiding bloat.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Enable Watch Mode
&lt;/h2&gt;

&lt;p&gt;Improve dev workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json-doc"&gt;&lt;code&gt;&lt;span class="nl"&gt;"dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"node --env-file=.env.local --watch src/app.ts"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This watches for file changes &lt;strong&gt;without extra tools&lt;/strong&gt; (no &lt;code&gt;nodemon&lt;/code&gt; or &lt;code&gt;ts-node&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  8. Node’s Inline Type Stripping: Behavior
&lt;/h2&gt;

&lt;p&gt;Node v23.6+ strips types automatically (no &lt;code&gt;--experimental-strip-types&lt;/code&gt; needed). E.g.,:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;calcSum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;calcSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// logs 4 — no type-checking&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;TypeScript errors won’t be caught at runtime—types serve only as editor aids.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Faster Dev with &lt;code&gt;ts-node-dev&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-D&lt;/span&gt; ts-node-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use in scripts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json-doc"&gt;&lt;code&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"tsnd --respawn src/app.ts"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ts-node-dev&lt;/code&gt; keeps TypeScript compiler in memory and restarts faster than &lt;code&gt;node-dev&lt;/code&gt; or &lt;code&gt;nodemon&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Remove &lt;code&gt;--transpile-only&lt;/code&gt; to enable full type-checking before runtime.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--respawn&lt;/code&gt; ensures clean restarts on file change.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  10. Build Output is In-Memory
&lt;/h2&gt;

&lt;p&gt;Even with &lt;code&gt;tsconfig.json&lt;/code&gt; configured (&lt;code&gt;rootDir: "src"&lt;/code&gt;, &lt;code&gt;outDir: "dist"&lt;/code&gt;), &lt;code&gt;ts-node-dev&lt;/code&gt; runs in-memory—so no &lt;code&gt;dist&lt;/code&gt; folder appears unless you compile manually.&lt;/p&gt;




&lt;h2&gt;
  
  
  11. Bun—Fast, but Selective Support
&lt;/h2&gt;

&lt;p&gt;You experimented with Bun:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json-doc"&gt;&lt;code&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"bun --watch src/app.ts"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"check"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"tsc --noEmit"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"build"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"bun build src/app.ts --outdir dist"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"bun run dist/app.js"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bun&lt;/strong&gt; is extremely fast and first-class TS, but OS support is not as universal as Node.&lt;/li&gt;
&lt;li&gt;Like Node, Bun &lt;strong&gt;strips types only&lt;/strong&gt; and relies on editor + &lt;code&gt;tsc&lt;/code&gt; for type-checking.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Summary Workflow
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Phase&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Dev&lt;/td&gt;
&lt;td&gt;&lt;code&gt;npm run dev&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Loads &lt;code&gt;.env.local&lt;/code&gt;, watches files, no type-check&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Build&lt;/td&gt;
&lt;td&gt;&lt;code&gt;npm run check &amp;amp;&amp;amp; tsc &amp;amp;&amp;amp; bun build&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Type-check + compile to &lt;code&gt;dist/&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Production&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;bun run dist/app.js&lt;/code&gt; or &lt;code&gt;node dist/app.js&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Run compiled code for consistency across OS&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;&lt;code&gt;.env.local&lt;/code&gt;&lt;/strong&gt; for dev, &lt;code&gt;.env&lt;/code&gt; for prod, and ignore both in Git.&lt;/li&gt;
&lt;li&gt;Node/Bun auto-strip TS types—they don’t type-check at runtime.&lt;/li&gt;
&lt;li&gt;For speed: use &lt;code&gt;ts-node-dev&lt;/code&gt; or Bun’s watch.&lt;/li&gt;
&lt;li&gt;For safety: run &lt;code&gt;tsc --noEmit&lt;/code&gt; during build or CI.&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Node&lt;/strong&gt; as your runtime for maximum OS compatibility; Bun is optional  for speed gains.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>bunjs</category>
      <category>node</category>
      <category>typescript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Set Up VS Code Extensions the Right Way — Express.js Series (Ep. 1 Highlights)</title>
      <dc:creator>Bello Osagie</dc:creator>
      <pubDate>Wed, 16 Jul 2025 18:41:18 +0000</pubDate>
      <link>https://dev.to/bello/set-up-vs-code-extensions-the-right-way-expressjs-series-ep-1-highlights-4e6p</link>
      <guid>https://dev.to/bello/set-up-vs-code-extensions-the-right-way-expressjs-series-ep-1-highlights-4e6p</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/cSDChpFW-Z4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;In the first episode of our &lt;strong&gt;Express.js Series&lt;/strong&gt;, we covered how to set up your macOS development environment using tools like &lt;strong&gt;Homebrew&lt;/strong&gt;, &lt;strong&gt;VS Code&lt;/strong&gt;, and &lt;strong&gt;Node.js via NVM&lt;/strong&gt;. But we also dove deep into an often overlooked aspect of developer experience — &lt;strong&gt;properly configuring VS Code extensions&lt;/strong&gt; and &lt;strong&gt;Amazon Q shell integration&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Even though you may have installed everything correctly, some tools &lt;em&gt;don’t just work out of the box&lt;/em&gt; unless you configure or activate them. Let’s walk through what we learned in the video 👇&lt;/p&gt;




&lt;h2&gt;
  
  
  Installing Extensions in VS Code
&lt;/h2&gt;

&lt;p&gt;VS Code makes it easy to install extensions — either:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using the &lt;strong&gt;Extensions sidebar&lt;/strong&gt; (click the Extensions icon on the left panel)&lt;/li&gt;
&lt;li&gt;Or installing them via a &lt;strong&gt;Brewfile&lt;/strong&gt; or &lt;strong&gt;Chocolatey&lt;/strong&gt; if you're on Windows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But installation is just the first step. Some extensions need &lt;strong&gt;manual activation&lt;/strong&gt; or configuration.&lt;/p&gt;




&lt;h2&gt;
  
  
  Amazon Q Extension in VS Code
&lt;/h2&gt;

&lt;p&gt;Even if you installed &lt;strong&gt;Amazon Q&lt;/strong&gt; (the AI-powered coding assistant) from the VS Code Marketplace &lt;em&gt;or&lt;/em&gt; via a Brewfile, &lt;strong&gt;it won't work&lt;/strong&gt; until you &lt;strong&gt;sign in&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;After installing Amazon Q:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click the &lt;strong&gt;Amazon Q icon&lt;/strong&gt; in the VS Code sidebar&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;"Sign In"&lt;/strong&gt; button&lt;/li&gt;
&lt;li&gt;Complete the sign-in process via your browser&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once signed in, it should begin offering code suggestions and inline assistance.&lt;/p&gt;




&lt;h2&gt;
  
  
  GitHub Theme Not Working?
&lt;/h2&gt;

&lt;p&gt;If you installed the &lt;strong&gt;GitHub Theme&lt;/strong&gt; but don’t see any visual changes, here’s what’s probably missing:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;After installation, VS Code does &lt;strong&gt;not&lt;/strong&gt; automatically apply the new theme.&lt;/li&gt;
&lt;li&gt;You need to manually select it by:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Pressing &lt;code&gt;Cmd + Shift + P&lt;/code&gt; (Mac) or &lt;code&gt;Ctrl + Shift + P&lt;/code&gt; (Windows)&lt;/li&gt;
&lt;li&gt;Typing &lt;code&gt;Color Theme&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Clicking &lt;strong&gt;"Set Color Theme"&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Choosing the GitHub theme from the list&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now you’ll get that clean GitHub look.&lt;/p&gt;




&lt;h2&gt;
  
  
  Material Icon Theme Not Applied?
&lt;/h2&gt;

&lt;p&gt;Same issue here. Installing the &lt;strong&gt;Material Icon Theme&lt;/strong&gt; isn’t enough. To activate it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the Command Palette (&lt;code&gt;Cmd/Ctrl + Shift + P&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Search for &lt;strong&gt;"Set Icon Theme"&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Material Icon Theme&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once activated, you’ll notice your file icons change to the familiar Material Design styles.&lt;/p&gt;




&lt;h2&gt;
  
  
  Postman Web: Sign In to Use It
&lt;/h2&gt;

&lt;p&gt;If you're using the &lt;strong&gt;Postman web app&lt;/strong&gt; (instead of the desktop version):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You must &lt;strong&gt;sign in&lt;/strong&gt; before making requests&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Sign In&lt;/strong&gt; button (usually top-right)&lt;/li&gt;
&lt;li&gt;Complete the authentication process&lt;/li&gt;
&lt;li&gt;Once signed in, you can start making requests just like the desktop app&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Extensions That Work Automatically (No Config Needed)
&lt;/h2&gt;

&lt;p&gt;Some extensions &lt;strong&gt;work instantly&lt;/strong&gt; without additional steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Markdown All in One&lt;/strong&gt;&lt;br&gt;
→ Just open a &lt;code&gt;.md&lt;/code&gt; file like &lt;code&gt;README.md&lt;/code&gt;&lt;br&gt;
→ Use &lt;code&gt;Cmd/Ctrl + Shift + P&lt;/code&gt; and select &lt;code&gt;Markdown: Open Preview&lt;/code&gt; to see a live preview&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Prettier&lt;/strong&gt; and &lt;strong&gt;Biome&lt;/strong&gt;&lt;br&gt;
→ These can auto-format your files on save if VS Code is set to format on save&lt;br&gt;
→ No additional config needed for basic usage&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Global Tools: Amazon Q in Terminal (Shell Integration)
&lt;/h2&gt;

&lt;p&gt;Besides the VS Code extension, &lt;strong&gt;Amazon Q&lt;/strong&gt; also offers a &lt;strong&gt;global shell assistant&lt;/strong&gt; that works in the terminal (both standalone and in VS Code).&lt;/p&gt;

&lt;h3&gt;
  
  
  But here's the key: it doesn’t work until you set it up correctly.
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Search for &lt;strong&gt;Amazon Q&lt;/strong&gt; from your system search bar (Spotlight on macOS)&lt;/li&gt;
&lt;li&gt;Open the app and click:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;"Get Started"&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;"Install Shell Integration"&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;"Sign In"&lt;/strong&gt; (if not signed in)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the Amazon Q window, go to &lt;strong&gt;Help &amp;amp; Support&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make sure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Shell Integration is Enabled&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Accessibility is Enabled&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Once set up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open a new terminal (outside VS Code) and try typing a command&lt;/li&gt;
&lt;li&gt;You’ll get inline suggestions from Amazon Q&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;Ctrl + K&lt;/code&gt; to expand the full suggestion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Bonus Tip:&lt;/strong&gt; It also works inside the &lt;strong&gt;VS Code integrated terminal&lt;/strong&gt;, &lt;strong&gt;but only if&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;VS Code is restarted &lt;em&gt;after&lt;/em&gt; shell integration is enabled&lt;/li&gt;
&lt;li&gt;Or run &lt;code&gt;exec $SHELL&lt;/code&gt; in the integrated terminal to reload it&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  If Amazon Q Isn't Working in Terminal...
&lt;/h2&gt;

&lt;p&gt;If you’re on &lt;strong&gt;macOS&lt;/strong&gt;, check for the &lt;strong&gt;Amazon Q icon&lt;/strong&gt; in the top menu bar.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If it's not working:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click the icon&lt;/li&gt;
&lt;li&gt;Check for any &lt;strong&gt;"Not Logged In"&lt;/strong&gt; messages&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;"Login"&lt;/strong&gt; or &lt;strong&gt;"Settings"&lt;/strong&gt; and re-authenticate&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Amazon Q shell support may be &lt;strong&gt;limited or unavailable&lt;/strong&gt; on &lt;strong&gt;Windows&lt;/strong&gt; at this time.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Setting up your environment goes beyond installing software — it’s about knowing what to configure and when.&lt;/p&gt;

&lt;p&gt;If you want a smoother experience with your development tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign into cloud-based tools (Amazon Q, Postman)&lt;/li&gt;
&lt;li&gt;Don’t forget to &lt;em&gt;activate&lt;/em&gt; themes and icons after installing&lt;/li&gt;
&lt;li&gt;Use the Command Palette (&lt;code&gt;Cmd/Ctrl + Shift + P&lt;/code&gt;) for most setup tasks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Want to go deeper? Check out the full setup video on YouTube or read the full blog post:&lt;br&gt;
&lt;strong&gt;👉 &lt;a href="https://dev.to/bello/setting-up-your-macos-dev-environment-for-nodejs-express-the-right-way-27l0"&gt;Set Up Node.js + VS Code the Right Way on macOS – Express Series Ep. 1&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>vscode</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Git and GitHub Crash Course for Express.js Developers</title>
      <dc:creator>Bello Osagie</dc:creator>
      <pubDate>Mon, 14 Jul 2025 22:50:16 +0000</pubDate>
      <link>https://dev.to/bello/git-and-github-crash-course-for-expressjs-developers-1o4m</link>
      <guid>https://dev.to/bello/git-and-github-crash-course-for-expressjs-developers-1o4m</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Us2gvkADJo4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A practical guide to version control, GitHub CLI, and managing branches using Git and GitHub with Express.js projects — no fluff, just real-world workflow.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Whether you're a beginner or working your way through a Node.js + Express.js project, using &lt;strong&gt;Git and GitHub&lt;/strong&gt; is essential for version control and team collaboration. In this guide, you’ll learn how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set up Git and GitHub from scratch&lt;/li&gt;
&lt;li&gt;Use Git in the terminal&lt;/li&gt;
&lt;li&gt;Use GitHub CLI to create and manage remote repositories&lt;/li&gt;
&lt;li&gt;Connect your local project to GitHub&lt;/li&gt;
&lt;li&gt;Create and switch between branches&lt;/li&gt;
&lt;li&gt;Work with GitHub directly from your browser via &lt;strong&gt;GitHub.dev&lt;/strong&gt; and &lt;strong&gt;VSCode.dev&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This guide is hands-on and practical — no prior Git knowledge needed!&lt;/p&gt;




&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Make sure you have the following installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Git&lt;/strong&gt; (&lt;code&gt;brew install git&lt;/code&gt; on macOS, &lt;code&gt;choco install git&lt;/code&gt; on Windows)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub CLI&lt;/strong&gt; (&lt;code&gt;gh&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;A GitHub account&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://vscode.dev" rel="noopener noreferrer"&gt;&lt;strong&gt;VSCode.dev&lt;/strong&gt;&lt;/a&gt; – Web-based VSCode&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.dev" rel="noopener noreferrer"&gt;&lt;strong&gt;GitHub.dev&lt;/strong&gt;&lt;/a&gt; – Open any GitHub repo in browser with &lt;code&gt;.dev&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Step-by-Step Guide
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Create or Sign In to Your GitHub Account&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If you don’t already have a GitHub account, &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;sign up here&lt;/a&gt;. This will allow you to push your code to the cloud and collaborate with others.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. &lt;strong&gt;Open VSCode.dev or GitHub.dev&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Visit &lt;code&gt;https://vscode.dev&lt;/code&gt; for a blank editor&lt;/li&gt;
&lt;li&gt;Or go to any GitHub repo and press &lt;code&gt;.&lt;/code&gt; to open &lt;code&gt;github.dev&lt;/code&gt; (web-based IDE)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Great for quick edits without local setup.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. &lt;strong&gt;Initialize Git in Your Local Project&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Navigate to your Express project folder and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This sets up a &lt;code&gt;.git&lt;/code&gt; directory and prepares your project for version control.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. &lt;strong&gt;Configure Git Author Info&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Set your username and email. You can use &lt;code&gt;--local&lt;/code&gt; (for this project) or &lt;code&gt;--global&lt;/code&gt; (applies to all repos):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--local&lt;/span&gt; user.name &lt;span class="s2"&gt;"Your Name"&lt;/span&gt;
git config &lt;span class="nt"&gt;--local&lt;/span&gt; user.email &lt;span class="s2"&gt;"you@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To confirm config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--list&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  5. &lt;strong&gt;Stage and Commit Your Changes&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Add all files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Commit them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Initial commit"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  6. &lt;strong&gt;Create a GitHub Repository Using GitHub CLI&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Use &lt;code&gt;gh&lt;/code&gt; (GitHub CLI) to create a new repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh repo create your-repo-name &lt;span class="nt"&gt;--public&lt;/span&gt; &lt;span class="nt"&gt;--source&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;--push&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This automatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creates the repo on GitHub&lt;/li&gt;
&lt;li&gt;Connects it to your local repo&lt;/li&gt;
&lt;li&gt;Pushes your code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you don’t have the GitHub CLI yet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;gh  &lt;span class="c"&gt;# on macOS&lt;/span&gt;
choco &lt;span class="nb"&gt;install &lt;/span&gt;gh  &lt;span class="c"&gt;# on Windows&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  7. &lt;strong&gt;Create and Switch to a New Branch&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; feature/branch-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; feature/2025/01-basic-dev-setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful when working on a new feature while keeping the &lt;code&gt;main&lt;/code&gt; branch stable.&lt;/p&gt;




&lt;h3&gt;
  
  
  8. &lt;strong&gt;Push Branch to GitHub&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin feature/2025/01-basic-dev-setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a remote branch and links it to your local one.&lt;/p&gt;




&lt;h2&gt;
  
  
  Summary Commands Cheat Sheet
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Initialize Git&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git init&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Configure Git&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git config --local user.name "Your Name"&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Add all files&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Commit changes&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git commit -m "message"&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Create branch&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git checkout -b branch-name&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Push branch&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git push -u origin branch-name&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Create repo (CLI)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;gh repo create&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Useful Tools
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.dev" rel="noopener noreferrer"&gt;GitHub.dev&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vscode.dev" rel="noopener noreferrer"&gt;VSCode.dev&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cli.github.com" rel="noopener noreferrer"&gt;GitHub CLI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://brew.sh" rel="noopener noreferrer"&gt;Homebrew&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://chocolatey.org" rel="noopener noreferrer"&gt;Chocolatey&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📽️ Bonus: Watch the Full Video Tutorial
&lt;/h2&gt;

&lt;p&gt;🎥 &lt;a href="https://youtu.be/Us2gvkADJo4?si=s3pnaN9nRnOH_VDK" rel="noopener noreferrer"&gt;Git &amp;amp; GitHub for Express Developers – Full Guide&lt;/a&gt;&lt;br&gt;
🖥️ Subscribe to &lt;a href="https://techstackspace.com" rel="noopener noreferrer"&gt;Techstack Space&lt;/a&gt; for more tutorials.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Now that you know how to set up and use Git and GitHub in your Express projects, you’re one step closer to becoming a professional full-stack developer.&lt;/p&gt;

&lt;p&gt;If you found this useful, share it, and let me know your questions in the comments!&lt;/p&gt;




&lt;h3&gt;
  
  
  Support This Project
&lt;/h3&gt;

&lt;p&gt;If you find value in this content, consider supporting Techstack Space:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://buymeacoffee.com/techstackmedia" rel="noopener noreferrer"&gt;☕ Buy Me a Coffee&lt;/a&gt;&lt;br&gt;
&lt;a href="https://techstackspace.com" rel="noopener noreferrer"&gt;🌐 Visit Our Website&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>vscode</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Setting Up Your Windows Dev Environment for Node.js &amp; Express (The Right Way)</title>
      <dc:creator>Bello Osagie</dc:creator>
      <pubDate>Sun, 13 Jul 2025 01:41:20 +0000</pubDate>
      <link>https://dev.to/bello/setting-up-your-windows-dev-environment-for-nodejs-express-the-right-way-2jod</link>
      <guid>https://dev.to/bello/setting-up-your-windows-dev-environment-for-nodejs-express-the-right-way-2jod</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/ZpHsRDOEgIw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This is Part 2 of my Express.js Series — setting up a solid foundation before we start writing any backend code.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Whether you're just diving into backend development or setting up a fresh environment, this guide walks you through a &lt;strong&gt;clean, scalable Windows development setup&lt;/strong&gt; tailored for &lt;strong&gt;Node.js&lt;/strong&gt; and &lt;strong&gt;Express.js&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why the Setup Matters
&lt;/h2&gt;

&lt;p&gt;Before jumping into building APIs, it's important to make sure your environment is consistent, efficient, and manageable. A cluttered or misconfigured system can lead to debugging nightmares.&lt;/p&gt;

&lt;p&gt;Instead of manually downloading everything, we'll use &lt;strong&gt;Chocolatey&lt;/strong&gt;, &lt;strong&gt;NVM for Windows&lt;/strong&gt;, and curated &lt;strong&gt;VS Code extensions&lt;/strong&gt; to streamline and future-proof your setup.&lt;/p&gt;




&lt;h2&gt;
  
  
  What We’re Setting Up
&lt;/h2&gt;

&lt;p&gt;By the end of this setup, you’ll have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chocolatey managing your dev tools&lt;/li&gt;
&lt;li&gt;Node.js versions managed cleanly via NVM&lt;/li&gt;
&lt;li&gt;A curated VS Code setup with powerful extensions&lt;/li&gt;
&lt;li&gt;MongoDB tools and CLI&lt;/li&gt;
&lt;li&gt;Git, Postman, a modern browser, and more&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Two Ways to Install Software on Windows
&lt;/h2&gt;

&lt;p&gt;Just like macOS, there are two main methods:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Manual Downloads from Websites&lt;/strong&gt;&lt;br&gt;
(e.g., download VS Code installer from the official site)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Command-line Installs with Chocolatey (Recommended)&lt;/strong&gt;&lt;br&gt;
Automate and simplify your entire setup with repeatable scripts&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 For devs, I strongly recommend using &lt;strong&gt;Chocolatey&lt;/strong&gt;. It's the Homebrew of Windows.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Installing Chocolatey
&lt;/h2&gt;

&lt;p&gt;Run PowerShell as &lt;strong&gt;Administrator&lt;/strong&gt; and paste this one-liner:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Set-ExecutionPolicy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Bypass&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Scope&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Process&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Force&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;`&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;System.Net.ServicePointManager&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="n"&gt;SecurityProtocol&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;`&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;System.Net.ServicePointManager&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="n"&gt;SecurityProtocol&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-bor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;3072&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;`&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;iex&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;New-Object&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;System.Net.WebClient&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;DownloadString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://chocolatey.org/install.ps1'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Confirm it’s working:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--version&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Installing Tools with Chocolatey
&lt;/h2&gt;

&lt;p&gt;Create a script file or run each command manually in &lt;strong&gt;Admin PowerShell&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;vscode&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;postman&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;googlechrome&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;arc-browser&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;warp-terminal&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mongodb-compass&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mongodb-database-tools&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;gh&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;bun&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;nvm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Some packages may need Chocolatey community extensions enabled. If prompted, just follow instructions or run:&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;feature&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;enable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-n&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;allowGlobalConfirmation&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the tutorial, a file named &lt;code&gt;choco-packages.config&lt;/code&gt; was created in the &lt;code&gt;express-app&lt;/code&gt; project directory, located at &lt;code&gt;C:\Users\YourUserName\Documents\express-app\config&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;packages&amp;gt;
  &amp;lt;package id="git" /&amp;gt;
  &amp;lt;package id="gh" /&amp;gt;
  &amp;lt;package id="bun" /&amp;gt;
  &amp;lt;package id="nvm" /&amp;gt;
  &amp;lt;package id="mongodb.install" /&amp;gt;
  &amp;lt;package id="mongodb-compass" /&amp;gt;
  &amp;lt;package id="mongodb-atlas" /&amp;gt;
  &amp;lt;package id="postman" /&amp;gt;
  &amp;lt;package id="vscode" /&amp;gt;
&amp;lt;/packages&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install all packages with the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;C:\Users\YourUserName\Documents\express-app\config\choco-packages.config\choco-packages.config&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Managing Node the Right Way: Use NVM
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why not use the global Node installer?
&lt;/h3&gt;

&lt;p&gt;Global installs can lead to version conflicts, especially when tools like MongoDB CLI bring their own Node dependencies.&lt;/p&gt;

&lt;h3&gt;
  
  
  NVM for Windows is better.
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;NVM lets you manage multiple Node.js versions side by side and switch between them effortlessly.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Steps to Use NVM (After Chocolatey Installs It)
&lt;/h3&gt;

&lt;p&gt;Open &lt;strong&gt;Command Prompt (not PowerShell)&lt;/strong&gt; and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nvm install 20.12.2
nvm use 20.12.2
nvm list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Switch versions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nvm install 18.17.0
nvm use 18.17.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove a version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nvm uninstall 18.17.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Confirm you're using the right version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node -v
npm -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  VS Code Extensions to Install
&lt;/h2&gt;

&lt;p&gt;Open VS Code and install these from the Extensions Marketplace:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;esbenp.prettier-vscode&lt;/code&gt; – Prettier code formatter&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mongodb.mongodb-vscode&lt;/code&gt; – MongoDB integration&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Postman.postman-for-vscode&lt;/code&gt; – Postman in VS Code&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;yzhang.markdown-all-in-one&lt;/code&gt; – Markdown tools&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PKief.material-icon-theme&lt;/code&gt; – Better file icons&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GitHub.github-vscode-theme&lt;/code&gt; – GitHub's official theme&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;biomejs.biome&lt;/code&gt; – All-in-one linting/formatting&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bengreenier.vscode-node-readme&lt;/code&gt; – Auto README generator&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;AmazonWebServices.amazon-q-vscode&lt;/code&gt; – Amazon Q AI assistant&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also install them via CLI using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;code &lt;span class="nt"&gt;--install-extension&lt;/span&gt; esbenp.prettier-vscode
code &lt;span class="nt"&gt;--install-extension&lt;/span&gt; mongodb.mongodb-vscode
&lt;span class="c"&gt;# ... and so on&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Recap: Tools We Installed
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VS Code&lt;/td&gt;
&lt;td&gt;Code editor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arc &amp;amp; Chrome&lt;/td&gt;
&lt;td&gt;Browsers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Git &amp;amp; GitHub CLI&lt;/td&gt;
&lt;td&gt;Version control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MongoDB tools&lt;/td&gt;
&lt;td&gt;Database management&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Postman&lt;/td&gt;
&lt;td&gt;API testing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bun&lt;/td&gt;
&lt;td&gt;JS runtime alternative&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NVM for Windows&lt;/td&gt;
&lt;td&gt;Node version management&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Warp Terminal&lt;/td&gt;
&lt;td&gt;Modern dev terminal&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Watch the Video Tutorial
&lt;/h2&gt;

&lt;p&gt;Prefer to see this step-by-step? I walk through the entire setup process visually in this episode:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/ZpHsRDOEgIw" rel="noopener noreferrer"&gt;Watch on YouTube&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What’s Next?
&lt;/h2&gt;

&lt;p&gt;In the next part of the series, we’ll initialize a real Express.js project and start building APIs with proper structure and tooling.&lt;/p&gt;

&lt;p&gt;Subscribe so you don’t miss it!&lt;/p&gt;




&lt;h3&gt;
  
  
  Feedback?
&lt;/h3&gt;

&lt;p&gt;Drop your thoughts, suggestions, or questions in the comments — I’m always happy to help or improve future tutorials!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>express</category>
      <category>mongodb</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Setting Up Your macOS Dev Environment for Node.js &amp; Express (The Right Way)</title>
      <dc:creator>Bello Osagie</dc:creator>
      <pubDate>Fri, 11 Jul 2025 21:46:04 +0000</pubDate>
      <link>https://dev.to/bello/setting-up-your-macos-dev-environment-for-nodejs-express-the-right-way-27l0</link>
      <guid>https://dev.to/bello/setting-up-your-macos-dev-environment-for-nodejs-express-the-right-way-27l0</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Ox20Lxu6qnI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This is Part 1 of my Express.js Series — setting up a solid foundation before we start writing any backend code.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Whether you're a beginner diving into backend development or an experienced dev ready to streamline your setup, this guide walks you through a &lt;strong&gt;clean, scalable macOS development environment&lt;/strong&gt; tailored for &lt;strong&gt;Node.js&lt;/strong&gt; and &lt;strong&gt;Express&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why the Setup Matters
&lt;/h2&gt;

&lt;p&gt;Before jumping into building APIs with Express.js, it's important to ensure your environment is clean, consistent, and developer-friendly.&lt;/p&gt;

&lt;p&gt;Instead of installing everything manually from random websites, we’ll leverage tools like &lt;strong&gt;Homebrew&lt;/strong&gt;, &lt;strong&gt;NVM&lt;/strong&gt;, and &lt;strong&gt;VS Code extensions&lt;/strong&gt; — automating the process and making it repeatable.&lt;/p&gt;




&lt;h2&gt;
  
  
  What We're Setting Up
&lt;/h2&gt;

&lt;p&gt;By the end of this setup, you’ll have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Homebrew managing your dev tools&lt;/li&gt;
&lt;li&gt;Node.js versions managed cleanly via NVM&lt;/li&gt;
&lt;li&gt;A curated VS Code setup with key extensions&lt;/li&gt;
&lt;li&gt;MongoDB tools and CLI&lt;/li&gt;
&lt;li&gt;Git, Postman, Arc, Warp Terminal, and more&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Two Ways to Install Software
&lt;/h2&gt;

&lt;p&gt;When it comes to installing tools on macOS, you have &lt;strong&gt;two main choices&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Traditional GUI Installers&lt;/strong&gt;&lt;br&gt;
Downloading installers from each software’s website (e.g., vscode.dev, postman.com)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Command-Line Install with Homebrew&lt;/strong&gt;&lt;br&gt;
Automating setup with &lt;code&gt;brew&lt;/code&gt;, &lt;code&gt;brew cask&lt;/code&gt;, and even managing VS Code extensions&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;I prefer &lt;strong&gt;Homebrew&lt;/strong&gt;, especially for developers, because it makes your setup easier to track, reproduce, and maintain.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Installing Homebrew
&lt;/h2&gt;

&lt;p&gt;If you haven't already installed Homebrew, use this one-liner in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/bin/bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Setting Up with a Brewfile
&lt;/h2&gt;

&lt;p&gt;We’re using a &lt;strong&gt;Brewfile&lt;/strong&gt; to install all our tools in one shot. You can create one at:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/Documents/express-app/config/macOS/Brewfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste this into the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;brew&lt;/span&gt; &lt;span class="s2"&gt;"gh"&lt;/span&gt;
&lt;span class="n"&gt;brew&lt;/span&gt; &lt;span class="s2"&gt;"git"&lt;/span&gt;
&lt;span class="n"&gt;brew&lt;/span&gt; &lt;span class="s2"&gt;"mongodb-community@6.0"&lt;/span&gt;
&lt;span class="n"&gt;brew&lt;/span&gt; &lt;span class="s2"&gt;"mongodb-atlas-cli"&lt;/span&gt;
&lt;span class="n"&gt;brew&lt;/span&gt; &lt;span class="s2"&gt;"oven-sh/bun/bun"&lt;/span&gt;
&lt;span class="n"&gt;brew&lt;/span&gt; &lt;span class="s2"&gt;"mongodb/brew/mongosh"&lt;/span&gt;

&lt;span class="n"&gt;cask&lt;/span&gt; &lt;span class="s2"&gt;"amazon-q"&lt;/span&gt;
&lt;span class="n"&gt;cask&lt;/span&gt; &lt;span class="s2"&gt;"postman"&lt;/span&gt;
&lt;span class="n"&gt;cask&lt;/span&gt; &lt;span class="s2"&gt;"arc"&lt;/span&gt;
&lt;span class="n"&gt;cask&lt;/span&gt; &lt;span class="s2"&gt;"visual-studio-code"&lt;/span&gt;
&lt;span class="n"&gt;cask&lt;/span&gt; &lt;span class="s2"&gt;"warp"&lt;/span&gt;
&lt;span class="n"&gt;cask&lt;/span&gt; &lt;span class="s2"&gt;"mongodb-compass"&lt;/span&gt;

&lt;span class="n"&gt;vscode&lt;/span&gt; &lt;span class="s2"&gt;"mongodb.mongodb-vscode"&lt;/span&gt;
&lt;span class="n"&gt;vscode&lt;/span&gt; &lt;span class="s2"&gt;"bengreenier.vscode-node-readme"&lt;/span&gt;
&lt;span class="n"&gt;vscode&lt;/span&gt; &lt;span class="s2"&gt;"yzhang.markdown-all-in-one"&lt;/span&gt;
&lt;span class="n"&gt;vscode&lt;/span&gt; &lt;span class="s2"&gt;"Postman.postman-for-vscode"&lt;/span&gt;
&lt;span class="n"&gt;vscode&lt;/span&gt; &lt;span class="s2"&gt;"esbenp.prettier-vscode"&lt;/span&gt;
&lt;span class="n"&gt;vscode&lt;/span&gt; &lt;span class="s2"&gt;"GitHub.github-vscode-theme"&lt;/span&gt;
&lt;span class="n"&gt;vscode&lt;/span&gt; &lt;span class="s2"&gt;"PKief.material-icon-theme"&lt;/span&gt;
&lt;span class="n"&gt;vscode&lt;/span&gt; &lt;span class="s2"&gt;"biomejs.biome"&lt;/span&gt;
&lt;span class="n"&gt;vscode&lt;/span&gt; &lt;span class="s2"&gt;"AmazonWebServices.amazon-q-vscode"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew bundle &lt;span class="nt"&gt;--file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;~/Documents/express-app/config/macOS/Brewfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This installs all listed apps, CLI tools, and VS Code extensions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Fixing Node.js the Smart Way: Use NVM
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why not just use the global Node installation?
&lt;/h3&gt;

&lt;p&gt;Tools like MongoDB CLIs often install Node.js as a dependency. But that’s not ideal. You don’t want multiple tools messing with global Node.&lt;/p&gt;

&lt;h3&gt;
  
  
  Here's what I did:
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Uninstall Node via Brew:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew uninstall node
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Install NVM (Node Version Manager):
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-o-&lt;/span&gt; https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then restart your terminal or run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;NVM_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/.nvm"&lt;/span&gt;
&lt;span class="nb"&gt;source&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$NVM_DIR&lt;/span&gt;&lt;span class="s2"&gt;/nvm.sh"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  3. Use NVM to manage Node:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nvm &lt;span class="nb"&gt;install &lt;/span&gt;node       &lt;span class="c"&gt;# Installs latest version&lt;/span&gt;
nvm use node
nvm &lt;span class="nb"&gt;ls&lt;/span&gt;                 &lt;span class="c"&gt;# Lists installed versions&lt;/span&gt;
nvm &lt;span class="nb"&gt;alias &lt;/span&gt;default node &lt;span class="c"&gt;# Sets default&lt;/span&gt;
nvm uninstall 20       &lt;span class="c"&gt;# Example: Uninstalls a version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you're in full control of your Node versions—perfect for development and debugging.&lt;/p&gt;




&lt;h2&gt;
  
  
  Recap: Tools We Installed
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;VS Code&lt;/td&gt;
&lt;td&gt;Code editor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arc &amp;amp; Warp&lt;/td&gt;
&lt;td&gt;Modern browsers/terminals&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Git &amp;amp; GitHub CLI&lt;/td&gt;
&lt;td&gt;Version control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MongoDB tools&lt;/td&gt;
&lt;td&gt;Database management&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Postman&lt;/td&gt;
&lt;td&gt;API testing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Amazon Q&lt;/td&gt;
&lt;td&gt;AI pair programmer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bun&lt;/td&gt;
&lt;td&gt;JS runtime alternative&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NVM&lt;/td&gt;
&lt;td&gt;Node version management&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Watch the Video Tutorial
&lt;/h2&gt;

&lt;p&gt;If you prefer to follow along visually, check out the video that walks through this exact setup step-by-step:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/Ox20Lxu6qnI" rel="noopener noreferrer"&gt;Watch on YouTube&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;In the next episode, we’ll initialize our Express.js project and start building real APIs!&lt;/p&gt;

&lt;p&gt;Make sure you subscribe to stay updated and follow along.&lt;/p&gt;




&lt;h3&gt;
  
  
  Feedback?
&lt;/h3&gt;

&lt;p&gt;Drop a comment below or on the video if you ran into any issues or want to recommend more tools for the setup!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>express</category>
      <category>node</category>
      <category>mongodb</category>
    </item>
    <item>
      <title>Git &amp; GitHub Setup Guide for Beginners</title>
      <dc:creator>Bello Osagie</dc:creator>
      <pubDate>Fri, 28 Mar 2025 17:52:44 +0000</pubDate>
      <link>https://dev.to/bello/git-github-setup-guide-for-beginners-168c</link>
      <guid>https://dev.to/bello/git-github-setup-guide-for-beginners-168c</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;This guide provides a structured approach to setting up Git, GitHub, Homebrew (for macOS), and Chocolatey (for Windows). It also covers the installation of essential tools like Amazon Q, Arc Browser, and Warp Terminal. Whether you're a beginner or an experienced developer, follow this guide step by step to configure your development environment efficiently.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. GitHub CLI (&lt;code&gt;gh&lt;/code&gt;) and Authentication
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;gh&lt;/code&gt; command-line tool allows you to interact with GitHub directly from your terminal. It simplifies repo management, pull requests, issues, and CI/CD workflows.&lt;/p&gt;

&lt;h3&gt;
  
  
  Authenticate GitHub CLI
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh auth login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once configured, you can see your Git global settings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--list&lt;/span&gt; &lt;span class="nt"&gt;--global&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To remove GitHub authentication data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh auth &lt;span class="nb"&gt;logout&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt; github.com
&lt;span class="nb"&gt;rm&lt;/span&gt; ~/.git-credentials
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.ssh/
&lt;span class="nb"&gt;rm&lt;/span&gt; ~/.gitconfig
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"url=https://github.com"&lt;/span&gt; | git credential reject
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; ~/.config/gh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running &lt;code&gt;echo "url=https://github.com" | git credential reject&lt;/code&gt; may not work on all systems. In that case, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git credential reject https://github.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  2. Initializing a Git Repository
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Git Initialization (&lt;code&gt;git init&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; &lt;span class="c"&gt;# Lists all files including hidden ones&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; .git &lt;span class="c"&gt;# View the .git directory&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Understanding the &lt;code&gt;.git&lt;/code&gt; Folder
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HEAD&lt;/strong&gt;: Points to the current branch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;config&lt;/strong&gt;: Stores repository settings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;refs/&lt;/strong&gt;: Contains references to commits (branches and tags).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;objects/&lt;/strong&gt;: Stores commit objects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;hooks/&lt;/strong&gt;: Scripts that trigger on Git events.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To view details inside &lt;code&gt;.git&lt;/code&gt;, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; .git/HEAD
&lt;span class="nb"&gt;cat&lt;/span&gt; .git/config
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; .git/refs/heads/ &lt;span class="c"&gt;# See available branches&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; .git/objects/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  3. Tracking Changes with Git
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Adding Files to Staging
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &amp;lt;file_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Committing Changes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Added new file"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pushing Changes to GitHub
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Undoing Commits
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Undo the last commit (keep changes unstaged):
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git reset &lt;span class="nt"&gt;--soft&lt;/span&gt; HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Undo the last commit (discard changes):
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git reset &lt;span class="nt"&gt;--hard&lt;/span&gt; HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Resolving Merge Conflicts
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status &lt;span class="c"&gt;# Check conflicts&lt;/span&gt;
nano &amp;lt;conflicted_file&amp;gt; &lt;span class="c"&gt;# Edit the file to resolve conflicts&lt;/span&gt;
git add &amp;lt;conflicted_file&amp;gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Resolved merge conflict"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  4. Git Configuration and Credential Management
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Checking Local &amp;amp; Global Git Configuration
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--list&lt;/span&gt; &lt;span class="nt"&gt;--local&lt;/span&gt; &lt;span class="c"&gt;# Show local repository settings&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; &lt;span class="nt"&gt;--list&lt;/span&gt; &lt;span class="c"&gt;# Show global settings&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Storing Credentials
&lt;/h3&gt;

&lt;h4&gt;
  
  
  macOS:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; credential.helper osxkeychain
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Linux:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; credential.helper cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Changing Default Editor
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Use Nano:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; core.editor nano
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Use VS Code:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; core.editor &lt;span class="s2"&gt;"code --wait"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  5. Installing Homebrew (macOS)
&lt;/h2&gt;

&lt;p&gt;Homebrew is a package manager for macOS that simplifies software installation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Homebrew
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/bin/bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Useful Homebrew Commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew search &amp;lt;package&amp;gt;
brew info &amp;lt;package&amp;gt;
brew &lt;span class="nb"&gt;install&lt;/span&gt; &amp;lt;package&amp;gt;
brew update
brew upgrade
brew list
brew uninstall &amp;lt;package&amp;gt;
brew cleanup &lt;span class="c"&gt;# Remove old versions and free space&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  6. Installing Chocolatey (Windows)
&lt;/h2&gt;

&lt;p&gt;Chocolatey is a package manager for Windows that simplifies software installation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Chocolatey
&lt;/h3&gt;

&lt;p&gt;Run &lt;strong&gt;PowerShell as Administrator&lt;/strong&gt; and execute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Set-ExecutionPolicy Bypass &lt;span class="nt"&gt;-Scope&lt;/span&gt; Process &lt;span class="nt"&gt;-Force&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;System.Net.ServicePointManager]::SecurityProtocol &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;System.Net.ServicePointManager]::SecurityProtocol &lt;span class="nt"&gt;-bor&lt;/span&gt; 3072&lt;span class="p"&gt;;&lt;/span&gt; iex &lt;span class="o"&gt;((&lt;/span&gt;New-Object System.Net.WebClient&lt;span class="o"&gt;)&lt;/span&gt;.DownloadString&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://community.chocolatey.org/install.ps1'&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Verifying Installation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;choco -?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  7. Installing Essential Development Tools
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Installing Git
&lt;/h3&gt;

&lt;h4&gt;
  
  
  macOS:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Windows:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;choco &lt;span class="nb"&gt;install &lt;/span&gt;git &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Installing VS Code
&lt;/h3&gt;

&lt;h4&gt;
  
  
  macOS:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--cask&lt;/span&gt; visual-studio-code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Windows:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;choco &lt;span class="nb"&gt;install &lt;/span&gt;vscode &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Installing Amazon Q
&lt;/h3&gt;

&lt;h4&gt;
  
  
  macOS:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--cask&lt;/span&gt; amazon-q
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Windows:
&lt;/h4&gt;

&lt;p&gt;First, check if &lt;code&gt;amazon-q&lt;/code&gt; exists in Chocolatey by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;choco search amazon-q
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If it exists, install it with:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;choco &lt;span class="nb"&gt;install &lt;/span&gt;amazon-q &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If it doesn't exist, try &lt;a href="https://aws.amazon.com/q/developer/" rel="noopener noreferrer"&gt;installing it manually&lt;/a&gt; via the command line. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Installing Warp Terminal
&lt;/h3&gt;

&lt;h4&gt;
  
  
  macOS:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--cask&lt;/span&gt; warp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Windows:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;choco &lt;span class="nb"&gt;install &lt;/span&gt;warp &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Installing Arc Browser
&lt;/h3&gt;

&lt;h4&gt;
  
  
  macOS:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew search arc
brew &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--cask&lt;/span&gt; arc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Windows:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;choco search arc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If unavailable, download manually from &lt;a href="https://arc.net/" rel="noopener noreferrer"&gt;Arc Browser&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Working in GitHub Codespaces
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open your repository in GitHub.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Code &amp;gt; Codespaces&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Continue Working in GitHub Codespace&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select an instance type based on your project needs:&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Basic&lt;/strong&gt;: Suitable for lightweight projects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Standard&lt;/strong&gt;: Recommended for most web and mobile development.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt;: For complex builds or heavy computation.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  9. GitHub SSH Key Setup
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Generate a New SSH Key
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519 &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"your_email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Add SSH Key to GitHub
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.ssh/id_ed25519.pub &lt;span class="c"&gt;# Copy the key content&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then add it to &lt;strong&gt;GitHub &amp;gt; Settings &amp;gt; SSH Keys&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test SSH Connection
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-T&lt;/span&gt; git@github.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You're right! Let me break it down clearly and explain how it works step by step.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;10. Bonus: Configure Terminal for Quick Search and URL Opening&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Wouldn’t it be great if you could open websites or search Google directly from the terminal using a simple command like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;oh &lt;span class="s2"&gt;"github.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;(Opens &lt;code&gt;https://github.com&lt;/code&gt; in your browser)&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;oh &lt;span class="s2"&gt;"how to install python"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;(Searches Google for "how to install python")&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;Let’s set it up! &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Step 1: Check Your Default Shell&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Before adding the function, confirm whether you are using &lt;strong&gt;Zsh&lt;/strong&gt; or &lt;strong&gt;Bash&lt;/strong&gt; by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$SHELL&lt;/span&gt; &lt;span class="c"&gt;# or echo $0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If the output contains &lt;strong&gt;zsh&lt;/strong&gt; (e.g., &lt;code&gt;/bin/zsh&lt;/code&gt;), you will edit &lt;code&gt;~/.zshrc&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;If the output contains &lt;strong&gt;bash&lt;/strong&gt; (e.g., &lt;code&gt;/bin/bash&lt;/code&gt;), you will edit &lt;code&gt;~/.bashrc&lt;/code&gt;. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔹 &lt;strong&gt;macOS default shell is Zsh&lt;/strong&gt; (since macOS Catalina). &lt;br&gt;
🔹 &lt;strong&gt;Linux may use Bash or Zsh&lt;/strong&gt;, depending on the distribution.&lt;br&gt;
🔹 &lt;strong&gt;Window uses Bash&lt;/strong&gt; from Git Bash. &lt;/p&gt;


&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Step 2: Open the Configuration File&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;If using &lt;strong&gt;Zsh&lt;/strong&gt; (macOS default), open the Zsh configuration file:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;If using &lt;strong&gt;Bash&lt;/strong&gt; (common on Linux), open the Bash configuration file:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Step 3: Add the &lt;code&gt;oh&lt;/code&gt; Function&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Paste the following &lt;strong&gt;Mac-compatible function&lt;/strong&gt; in &lt;code&gt;~/.zshrc&lt;/code&gt; or &lt;code&gt;~/.bashrc&lt;/code&gt; (for Bash users). &lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;strong&gt;For macOS (Uses &lt;code&gt;open&lt;/code&gt;)&lt;/strong&gt;
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;oh&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;input&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$*&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="c"&gt;# Ensure input is a single word with a dot (like a real domain)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ ^[a-zA-Z0-9.-]+&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;a-zA-Z]&lt;span class="o"&gt;{&lt;/span&gt;2,&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ &lt;span class="se"&gt;\ &lt;/span&gt;&lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
&lt;/span&gt;open &lt;span class="s2"&gt;"https://&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;else
&lt;/span&gt;open &lt;span class="s2"&gt;"https://www.google.com/search?q=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;tr&lt;/span&gt; &lt;span class="s1"&gt;' '&lt;/span&gt; &lt;span class="s1"&gt;'+'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;For Linux (Uses &lt;code&gt;xdg-open&lt;/code&gt;)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;On Linux, replace &lt;code&gt;open&lt;/code&gt; with &lt;code&gt;xdg-open&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;oh&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;input&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$*&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="c"&gt;# Ensure input is a single word with a dot (like a domain), and doesn't contain spaces&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ ^[a-zA-Z0-9.-]+&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;a-zA-Z]&lt;span class="o"&gt;{&lt;/span&gt;2,&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ &lt;span class="o"&gt;[[&lt;/span&gt;:space:]] &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
&lt;/span&gt;xdg-open &lt;span class="s2"&gt;"https://&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;else
&lt;/span&gt;xdg-open &lt;span class="s2"&gt;"https://www.google.com/search?q=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;tr&lt;/span&gt; &lt;span class="s1"&gt;' '&lt;/span&gt; &lt;span class="s1"&gt;'+'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;For Windows (Uses &lt;code&gt;start&lt;/code&gt;)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;On Windows, replace &lt;code&gt;open&lt;/code&gt; or &lt;code&gt;xdg-open&lt;/code&gt; with &lt;code&gt;start&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;oh&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;input&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$*&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="c"&gt;# Ensure input is a valid domain (contains a dot and no spaces)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ ^[a-zA-Z0-9.-]+&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;a-zA-Z]&lt;span class="o"&gt;{&lt;/span&gt;2,&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ &lt;span class="o"&gt;[[&lt;/span&gt;:space:]] &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
&lt;/span&gt;powershell &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"Start-Process 'https://&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;'"&lt;/span&gt;
&lt;span class="k"&gt;else
&lt;/span&gt;powershell &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"Start-Process 'https://www.google.com/search?q=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;tr&lt;/span&gt; &lt;span class="s1"&gt;' '&lt;/span&gt; &lt;span class="s1"&gt;'+'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;'"&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;Cross-Platform Version (Auto-Detects OS)&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;If you want a single function that works on &lt;strong&gt;both macOS, Linux, and windows&lt;/strong&gt;, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;oh&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;input&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$*&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;local &lt;/span&gt;open_cmd

&lt;span class="c"&gt;# Detect OS and set the correct open command&lt;/span&gt;
&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;uname&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="k"&gt;in
&lt;/span&gt;Darwin&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;open_cmd&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"open"&lt;/span&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
Linux&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;open_cmd&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"xdg-open"&lt;/span&gt; &lt;span class="p"&gt;;;&lt;/span&gt; &lt;span class="c"&gt;# Linux (xdg-open should use an existing tab when possible)&lt;/span&gt;
CYGWIN&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;MINGW&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;MSYS&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;open_cmd&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"powershell -c start"&lt;/span&gt; &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Unsupported OS"&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="k"&gt;return &lt;/span&gt;1 &lt;span class="p"&gt;;;&lt;/span&gt;
&lt;span class="k"&gt;esac&lt;/span&gt;

&lt;span class="c"&gt;# Open URL or search Google&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ ^[a-zA-Z0-9.-]+&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;a-zA-Z]&lt;span class="o"&gt;{&lt;/span&gt;2,&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="nv"&gt;$open_cmd&lt;/span&gt; &lt;span class="s2"&gt;"https://&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
&lt;span class="nv"&gt;$open_cmd&lt;/span&gt; &lt;span class="s2"&gt;"https://www.google.com/search?q=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;tr&lt;/span&gt; &lt;span class="s1"&gt;' '&lt;/span&gt; &lt;span class="s1"&gt;'+'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Step 4: Save and Apply the Changes&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Press&lt;/strong&gt; &lt;code&gt;CTRL + X&lt;/code&gt; to exit. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Press&lt;/strong&gt; &lt;code&gt;Y&lt;/code&gt; to confirm saving. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Press&lt;/strong&gt; &lt;code&gt;ENTER&lt;/code&gt; to overwrite the file. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Then, apply the changes by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; ~/.zshrc &lt;span class="c"&gt;# If using Zsh&lt;/span&gt;
&lt;span class="nb"&gt;source&lt;/span&gt; ~/.bashrc &lt;span class="c"&gt;# If using Bash&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;🚀 Step 5: Try It Out!&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;✅ &lt;strong&gt;Open a Website:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;oh github.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;(Opens &lt;code&gt;https://github.com&lt;/code&gt; in your browser.)&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Perform a Google Search:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;oh &lt;span class="s2"&gt;"best terminal commands for Mac"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;(Opens Google search: &lt;code&gt;https://www.google.com/search?q=best+terminal+commands+for+Mac&lt;/code&gt;)&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Open Any Website Without Typing &lt;code&gt;https://&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;oh openai.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;(Opens &lt;code&gt;https://openai.com&lt;/code&gt;.)&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;🔍 How It Works&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Detects if the input is a domain&lt;/strong&gt; using regex (&lt;code&gt;^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$&lt;/code&gt;). &lt;/li&gt;
&lt;li&gt;If &lt;strong&gt;yes&lt;/strong&gt;, it adds &lt;code&gt;https://&lt;/code&gt; and opens the website. &lt;/li&gt;
&lt;li&gt;&lt;p&gt;If &lt;strong&gt;no&lt;/strong&gt;, it converts spaces to &lt;code&gt;+&lt;/code&gt; and performs a Google search. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Uses &lt;code&gt;open&lt;/code&gt; on &lt;strong&gt;macOS&lt;/strong&gt; and &lt;code&gt;xdg-open&lt;/code&gt; on &lt;strong&gt;Linux&lt;/strong&gt;, ensuring cross-platform compatibility. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;🔄 Troubleshooting&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;🔹 &lt;strong&gt;Browser doesn’t open?&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure &lt;code&gt;open&lt;/code&gt; (Mac) or &lt;code&gt;xdg-open&lt;/code&gt; (Linux) is available. &lt;/li&gt;
&lt;li&gt;On Linux, install &lt;code&gt;xdg-utils&lt;/code&gt; if missing:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;xdg-utils &lt;span class="c"&gt;# Debian/Ubuntu&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;xdg-utils &lt;span class="c"&gt;# Fedora&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;✅ &lt;strong&gt;Get all setup guides &amp;amp; commands here&lt;/strong&gt; 👉 &lt;a href="https://bit.ly/primary-dev-setup" rel="noopener noreferrer"&gt;Primary Dev Setup&lt;/a&gt; 🚀 &lt;/p&gt;

</description>
      <category>terminal</category>
      <category>cli</category>
      <category>github</category>
      <category>git</category>
    </item>
    <item>
      <title>Chocolatey Installation and Usage Guide</title>
      <dc:creator>Bello Osagie</dc:creator>
      <pubDate>Fri, 28 Mar 2025 17:45:27 +0000</pubDate>
      <link>https://dev.to/bello/chocolatey-installation-and-usage-guide-4hjj</link>
      <guid>https://dev.to/bello/chocolatey-installation-and-usage-guide-4hjj</guid>
      <description>&lt;h2&gt;
  
  
  What is Chocolatey?
&lt;/h2&gt;

&lt;p&gt;Chocolatey is a package manager for Windows that simplifies the installation, updating, and management of software applications and command-line tools. Similar to Homebrew on macOS, Chocolatey allows users to automate software installations using a single command.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking Your PowerShell Execution Policy
&lt;/h2&gt;

&lt;p&gt;Before installing Chocolatey, ensure that your PowerShell execution policy allows scripts to run. Open PowerShell as an administrator and check the current policy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Get-ExecutionPolicy&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it returns &lt;code&gt;Restricted&lt;/code&gt;, change it to &lt;code&gt;AllSigned&lt;/code&gt; or &lt;code&gt;Bypass&lt;/code&gt; temporarily:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Set-ExecutionPolicy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Bypass&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Scope&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Process&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Force&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allows Chocolatey to run its installation scripts without restrictions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Installing Chocolatey
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Open PowerShell as Administrator
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Press &lt;code&gt;Win + X&lt;/code&gt; and select &lt;strong&gt;Windows Terminal (Admin)&lt;/strong&gt; or &lt;strong&gt;PowerShell (Admin)&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 2: Run the Installation Command
&lt;/h3&gt;

&lt;p&gt;Copy and paste the following command into the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Set-ExecutionPolicy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Bypass&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Scope&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Process&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Force&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;System.Net.ServicePointManager&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="n"&gt;SecurityProtocol&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;System.Net.ServicePointManager&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="n"&gt;SecurityProtocol&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-bor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;3072&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;iex&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;New-Object&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;System.Net.WebClient&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;DownloadString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://community.chocolatey.org/install.ps1'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Press &lt;strong&gt;Enter&lt;/strong&gt; and wait for Chocolatey to install.&lt;/li&gt;
&lt;li&gt;Close and reopen PowerShell to apply changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 3: Verify Installation
&lt;/h3&gt;

&lt;p&gt;Run the following command to confirm Chocolatey is installed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-v&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If Chocolatey is installed correctly, it will return the installed version number.&lt;/p&gt;




&lt;h2&gt;
  
  
  Installing Git Using Chocolatey
&lt;/h2&gt;

&lt;p&gt;Installing Git via Chocolatey ensures you always have the latest version and simplifies updates.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;git&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c"&gt;# Search for Git&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c"&gt;# Install Git without confirmation prompt&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Verify Installation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--version&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c"&gt;# Check Git version&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;where.exe&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;git&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c"&gt;# Locate Git installation&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Installing Software with Chocolatey
&lt;/h2&gt;

&lt;p&gt;Chocolatey provides two package types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Standard Packages&lt;/strong&gt; (CLI tools like &lt;code&gt;git&lt;/code&gt;, &lt;code&gt;nodejs&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GUI Applications&lt;/strong&gt; (Apps like &lt;code&gt;Google Chrome&lt;/code&gt;, &lt;code&gt;VS Code&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Installing a CLI Package
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;nodejs&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c"&gt;# Install Node.js&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Installing a GUI Application
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;googlechrome&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c"&gt;# Install Google Chrome&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;-y&lt;/code&gt; flag skips confirmation prompts.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Managing Chocolatey Packages
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Listing Installed Packages
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--local-only&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c"&gt;# View installed packages&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Upgrading Installed Packages
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;upgrade&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;all&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c"&gt;# Upgrade all installed packages&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Uninstalling a Package
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;uninstall&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;package-name&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c"&gt;# Remove a specific package&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Running Chocolatey in Scripts
&lt;/h2&gt;

&lt;p&gt;To automate installations in scripts, use Chocolatey commands within &lt;code&gt;.ps1&lt;/code&gt; files. Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install multiple applications&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;vscode&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;nodejs&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;googlechrome&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the script in an &lt;strong&gt;elevated PowerShell session&lt;/strong&gt; to execute commands.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chocolatey GUI: A Visual Interface
&lt;/h2&gt;

&lt;p&gt;For users who prefer a graphical interface, install Chocolatey GUI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;chocolateygui&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run &lt;strong&gt;Chocolatey GUI&lt;/strong&gt; from the Start Menu to manage software visually.&lt;/p&gt;




&lt;h2&gt;
  
  
  Uninstalling Chocolatey
&lt;/h2&gt;

&lt;p&gt;If you need to remove Chocolatey, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;uninstall&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;chocolatey&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-y&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then manually delete the &lt;code&gt;C:\ProgramData\chocolatey&lt;/code&gt; folder to clean up residual files.&lt;/p&gt;




&lt;h2&gt;
  
  
  Exploring More Chocolatey Commands
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;help&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c"&gt;# View available commands&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;package-name&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c"&gt;# Get package details&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;outdated&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c"&gt;# Check for outdated packages&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a full package list, visit &lt;a href="https://community.chocolatey.org/packages" rel="noopener noreferrer"&gt;Chocolatey Community Repository&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;Chocolatey simplifies Windows package management, making software installations fast and efficient! 🚀&lt;/p&gt;

</description>
      <category>terminal</category>
      <category>cli</category>
      <category>microsoft</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Homebrew Installation and Usage Guide</title>
      <dc:creator>Bello Osagie</dc:creator>
      <pubDate>Thu, 27 Mar 2025 16:26:27 +0000</pubDate>
      <link>https://dev.to/bello/homebrew-installation-and-usage-guide-5b6j</link>
      <guid>https://dev.to/bello/homebrew-installation-and-usage-guide-5b6j</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/rCSUX_YiMpY"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Check out the &lt;a href="https://bit.ly/homebrew-guide" rel="noopener noreferrer"&gt;resources for this article&lt;/a&gt;. &lt;/p&gt;




&lt;h2&gt;
  
  
  What is Homebrew?
&lt;/h2&gt;

&lt;p&gt;Homebrew (often called brew) is a package manager for macOS and Linux that allows users to easily install, update, and manage software applications and command-line tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking Your Default Shell
&lt;/h2&gt;

&lt;p&gt;Before installing Homebrew, it's essential to verify which shell you are using. Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$SHELL&lt;/span&gt;  &lt;span class="c"&gt;# or&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're using Zsh (which is the default on modern macOS versions), you may need to configure certain environment variables differently than in Bash.&lt;/p&gt;

&lt;h3&gt;
  
  
  (Optional) Switch to Zsh
&lt;/h3&gt;

&lt;p&gt;If your default shell is not Zsh, you can switch using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/shells  &lt;span class="c"&gt;# List available shells&lt;/span&gt;
chsh &lt;span class="nt"&gt;-s&lt;/span&gt; /bin/zsh  &lt;span class="c"&gt;# Change default shell to Zsh&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Close the terminal and reopen it for changes to take effect.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before you start installing and using Homebrew to manage packages, make sure you have the &lt;strong&gt;Command Line Tools (CTL)&lt;/strong&gt; installed by running the following command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check if CTL is installed:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcode-select &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it does not return a valid installation path or shows an error like "command not found", install CTL using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xcode-select &lt;span class="nt"&gt;--install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will prompt a macOS dialog to install the necessary tools. Follow the instructions and wait for the installation to complete.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Homebrew
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Open the Homebrew Website
&lt;/h3&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xdg-open https://brew.sh  &lt;span class="c"&gt;# Linux&lt;/span&gt;
open https://brew.sh  &lt;span class="c"&gt;# macOS&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or visit &lt;a href="https://brew.sh" rel="noopener noreferrer"&gt;Homebrew&lt;/a&gt; manually.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Copy and Run the Installation Command
&lt;/h3&gt;

&lt;p&gt;Copy the installation script from the website and run it in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/bin/bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;You may need to enter your password to allow &lt;code&gt;sudo&lt;/code&gt; access.&lt;/li&gt;
&lt;li&gt;Follow interactive instructions to add Homebrew to your &lt;code&gt;PATH&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;To &lt;strong&gt;uninstall&lt;/strong&gt; Homebrew, replace &lt;code&gt;/install.sh/&lt;/code&gt; with &lt;code&gt;/uninstall.sh/&lt;/code&gt; in the command.&lt;/li&gt;
&lt;li&gt;Before uninstalling Homebrew, first remove all installed packages to avoid orphaned files.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 3: Configure Environment Variables
&lt;/h3&gt;

&lt;p&gt;Since &lt;code&gt;zprofile&lt;/code&gt; loads once per login session, set the Homebrew path there:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.zprofile  &lt;span class="c"&gt;# View existing configurations&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To modify it, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vim ~/.zprofile  &lt;span class="c"&gt;# or&lt;/span&gt;
nano ~/.zprofile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If Homebrew is uninstalled, ensure you remove its path from &lt;code&gt;.zprofile&lt;/code&gt; or &lt;code&gt;.zshrc&lt;/code&gt; to prevent errors.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Verify Installation
&lt;/h3&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nt"&gt;--prefix&lt;/span&gt;  &lt;span class="c"&gt;# Confirm Homebrew’s location&lt;/span&gt;
brew &lt;span class="nt"&gt;-v&lt;/span&gt;  &lt;span class="c"&gt;# Check installed version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Installing Git Using Homebrew
&lt;/h2&gt;

&lt;p&gt;Even though Git is preinstalled on macOS and Linux, installing it via Homebrew ensures easier updates.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew search git  &lt;span class="c"&gt;# Search for Git&lt;/span&gt;
brew &lt;span class="nb"&gt;install &lt;/span&gt;git  &lt;span class="c"&gt;# Install Git&lt;/span&gt;
brew &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--formula&lt;/span&gt; git  &lt;span class="c"&gt;# Explicitly install as a formula&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;During installation, dependencies like &lt;code&gt;gettext&lt;/code&gt;, &lt;code&gt;pcre2&lt;/code&gt;, and &lt;code&gt;libunistring&lt;/code&gt; may also be installed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Verify Installation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git &lt;span class="nt"&gt;--version&lt;/span&gt;  &lt;span class="c"&gt;# Check Git version&lt;/span&gt;
which git  &lt;span class="c"&gt;# Locate Git installation&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Understanding Homebrew Package Types
&lt;/h2&gt;

&lt;p&gt;Homebrew has two main package types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Formulae&lt;/strong&gt; (command-line tools, e.g., &lt;code&gt;git&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Casks&lt;/strong&gt; (GUI applications, e.g., &lt;code&gt;Arc Browser&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To install a cask package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew search arc  &lt;span class="c"&gt;# Search for Arc Browser&lt;/span&gt;
brew &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--cask&lt;/span&gt; arc  &lt;span class="c"&gt;# Install Arc Browser&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Good practice: Always use &lt;code&gt;--cask&lt;/code&gt; when installing GUI apps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Listing Installed Packages
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew list  &lt;span class="c"&gt;# List installed packages&lt;/span&gt;
brew list | &lt;span class="nb"&gt;grep &lt;/span&gt;git  &lt;span class="c"&gt;# Filter results using `grep`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Managing Homebrew Packages
&lt;/h3&gt;

&lt;p&gt;Before upgrading or removing Homebrew packages, ensure Terminal has necessary permissions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Apple icon → Privacy &amp;amp; Security → App Management&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Toggle the button for &lt;strong&gt;Terminal&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Upgrade Packages
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew upgrade &lt;span class="nt"&gt;--cask&lt;/span&gt; arc  &lt;span class="c"&gt;# Upgrade a specific package&lt;/span&gt;
brew upgrade &lt;span class="nt"&gt;--greedy&lt;/span&gt;  &lt;span class="c"&gt;# Upgrade all dependencies&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Uninstall Packages
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew uninstall &lt;span class="nt"&gt;--formula&lt;/span&gt; &amp;lt;package-name&amp;gt;  &lt;span class="c"&gt;# Remove a formula package&lt;/span&gt;
brew uninstall &lt;span class="nt"&gt;--cask&lt;/span&gt; &amp;lt;package-name&amp;gt;  &lt;span class="c"&gt;# Remove a cask package&lt;/span&gt;
brew uninstall &lt;span class="nt"&gt;--zap&lt;/span&gt; &lt;span class="nt"&gt;--cask&lt;/span&gt; &amp;lt;package-name&amp;gt;  &lt;span class="c"&gt;# Extra cleanup for GUI apps&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;--zap&lt;/code&gt; flag in &lt;code&gt;brew uninstall&lt;/code&gt; should only be used for cask packages (GUI applications)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Cleanup Unused Packages
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew cleanup  &lt;span class="c"&gt;# Free up space by removing old versions&lt;/span&gt;
brew autoremove  &lt;span class="c"&gt;# Remove orphaned dependencies&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Exploring Homebrew Commands
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;help&lt;/span&gt;  &lt;span class="c"&gt;# View basic commands&lt;/span&gt;
brew info &amp;lt;package-name&amp;gt;  &lt;span class="c"&gt;# Get details about a package&lt;/span&gt;
man brew  &lt;span class="c"&gt;# View all available commands&lt;/span&gt;
brew home  &lt;span class="c"&gt;# Open Homebrew homepage&lt;/span&gt;
brew docs  &lt;span class="c"&gt;# Open Homebrew documentation&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For searching packages manually, visit &lt;a href="https://formulae.brew.sh" rel="noopener noreferrer"&gt;Homebrew Formulae&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  User-Specific Settings: Opening Websites from Terminal
&lt;/h2&gt;

&lt;p&gt;To avoid typing &lt;code&gt;https://&lt;/code&gt; every time, add this function to your &lt;code&gt;~/.zshrc&lt;/code&gt; (for Zsh) or &lt;code&gt;~/.bashrc&lt;/code&gt; (for Bash):&lt;/p&gt;

&lt;h3&gt;
  
  
  macOS (Uses &lt;code&gt;open&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;oh&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;input&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$*&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ ^[a-zA-Z0-9.-]+&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;a-zA-Z]&lt;span class="o"&gt;{&lt;/span&gt;2,&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ &lt;span class="se"&gt;\ &lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;open &lt;span class="s2"&gt;"https://&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;else
    &lt;/span&gt;open &lt;span class="s2"&gt;"https://www.google.com/search?q=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;tr&lt;/span&gt; &lt;span class="s1"&gt;' '&lt;/span&gt; &lt;span class="s1"&gt;'+'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Linux (Uses &lt;code&gt;xdg-open&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;oh&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;local &lt;/span&gt;&lt;span class="nv"&gt;input&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$*&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ ^[a-zA-Z0-9.-]+&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;a-zA-Z]&lt;span class="o"&gt;{&lt;/span&gt;2,&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ &lt;span class="o"&gt;[[&lt;/span&gt;:space:]] &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;xdg-open &lt;span class="s2"&gt;"https://&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;else
    &lt;/span&gt;xdg-open &lt;span class="s2"&gt;"https://www.google.com/search?q=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;tr&lt;/span&gt; &lt;span class="s1"&gt;' '&lt;/span&gt; &lt;span class="s1"&gt;'+'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Source the file to apply changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; ~/.zshrc  &lt;span class="c"&gt;# or source ~/.bashrc&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, simply typing &lt;code&gt;brew.sh&lt;/code&gt; will open the Homebrew website!&lt;/p&gt;




&lt;p&gt;This guide ensures a smooth Homebrew installation and management experience. 🚀&lt;/p&gt;

</description>
      <category>terminal</category>
      <category>linux</category>
      <category>bash</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Understanding Variables, Conditionals, Loops, and Arrays In C Programming</title>
      <dc:creator>Bello Osagie</dc:creator>
      <pubDate>Sun, 16 Jul 2023 14:51:59 +0000</pubDate>
      <link>https://dev.to/bello/understanding-variables-conditionals-loops-and-arrays-in-c-programming-33k3</link>
      <guid>https://dev.to/bello/understanding-variables-conditionals-loops-and-arrays-in-c-programming-33k3</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/techstackmedia/software-engineering-series/tree/17-understanding-variables-conditionals-loop-and-arrays-in-c" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fbizstak%2Fimage%2Fupload%2Fv1685060686%2Fgithub_f9ljwi.svg" alt="GitHub Logo" width="64" height="64"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this blog post, we'll go through the provided code in C step by step and explain each part in detail. This will help beginners understand the code and its logic. Let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Snippet
&lt;/h2&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Understanding Variables and Constants
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;firstNumber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;secondNumber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;myNumbers&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;myLanguages&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s"&gt;"C"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"C++"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Java"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"C#"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"PHP"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Python"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Ruby"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"JavaScript"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Rust"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Go"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Swift"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"R"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Kotlin"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;numLanguages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;myLanguages&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="k"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;myLanguages&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;counterIndex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In the above code snippet, we declare and initialize several variables and constants. Here's a breakdown:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;firstNumber&lt;/code&gt; and &lt;code&gt;secondNumber&lt;/code&gt; are constants representing integer values.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;day&lt;/code&gt; represents the current day as an integer.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;myNumbers&lt;/code&gt; is an array of integers that stores a collection of numbers.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;myLanguages&lt;/code&gt; is an array of strings (character pointers) that stores a collection of programming language names.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;numLanguages&lt;/code&gt; is an integer that represents the number of languages in the &lt;code&gt;myLanguages&lt;/code&gt; array.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;counter&lt;/code&gt;, &lt;code&gt;counterIndex&lt;/code&gt;, &lt;code&gt;index&lt;/code&gt;, and &lt;code&gt;i&lt;/code&gt; are integer variables used for looping and counting purposes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Comparing Numbers using Conditionals
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;firstNumber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;secondNumber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;firstNumber&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;secondNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d is greater than secondNumber %d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;firstNumber&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;secondNumber&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nf"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;firstNumber&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;secondNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d is less than secondNumber %d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;firstNumber&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;secondNumber&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d is equivalent to secondNumber %d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;firstNumber&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;secondNumber&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;firstNumber&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;secondNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d is greater than secondNumber %d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;firstNumber&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;secondNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; 
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;firstNumber&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;secondNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d is less than secondNumber %d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;firstNumber&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;secondNumber&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d is equivalent to secondNumber %d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;firstNumber&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;secondNumber&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="cm"&gt;/*
30 is less than secondNumber 50
30 is less than secondNumber 50
*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;These code blocks demonstrate how to compare two numbers (&lt;code&gt;firstNumber&lt;/code&gt; and &lt;code&gt;secondNumber&lt;/code&gt;) using conditional statements (&lt;code&gt;if-else&lt;/code&gt; and the ternary operator &lt;code&gt;? :&lt;/code&gt;). The code checks if &lt;code&gt;firstNumber&lt;/code&gt; is greater than &lt;code&gt;secondNumber&lt;/code&gt;, less than &lt;code&gt;secondNumber&lt;/code&gt;, or equivalent to &lt;code&gt;secondNumber&lt;/code&gt;. The appropriate message is then printed based on the comparison.&lt;/p&gt;
&lt;h2&gt;
  
  
  Using a Switch Statement
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;day&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt; 
  &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Monday&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Tuesday&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Wednesday&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;default:&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Sunday&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="cm"&gt;/*
Tuesday
*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This switch statement checks the value of the &lt;code&gt;day&lt;/code&gt; variable and executes the corresponding code block. If &lt;code&gt;day&lt;/code&gt; is equal to 1, "Monday" is printed. If it is 2, "Tuesday" is printed. If it is 3, "Wednesday" is printed. If none of these cases match, the &lt;code&gt;default&lt;/code&gt; case is executed, and "Sunday" is printed.&lt;/p&gt;
&lt;h2&gt;
  
  
  Looping with While and Do-While
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"-----&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;counterIndex&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;counterIndex&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counterIndex&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="cm"&gt;/*
1
2
-----
1
2
*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;These code blocks demonstrate the usage of &lt;code&gt;while&lt;/code&gt; and &lt;code&gt;do-while&lt;/code&gt; loops. In the first block, the &lt;code&gt;while&lt;/code&gt; loop executes as long as &lt;code&gt;counter&lt;/code&gt; is less than 3. It prints the value of &lt;code&gt;counter&lt;/code&gt; and increments it by 1 in each iteration. In the second block, the &lt;code&gt;do-while&lt;/code&gt; loop executes at least once and continues until &lt;code&gt;counterIndex&lt;/code&gt; is less than 3. It prints the value of &lt;code&gt;counterIndex&lt;/code&gt; and increments it by 1 in each iteration.&lt;/p&gt;
&lt;h2&gt;
  
  
  Looping with For
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"-----&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="cm"&gt;/*
0
1
3
4
-----
0
1
3
4
*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;These code blocks showcase the usage of &lt;code&gt;for&lt;/code&gt; loops. In the first block, the &lt;code&gt;while&lt;/code&gt; loop continues until &lt;code&gt;index&lt;/code&gt; is less than 5. It skips the iteration when &lt;code&gt;index&lt;/code&gt; is equal to 2 using the &lt;code&gt;continue&lt;/code&gt; statement. In the second block, the &lt;code&gt;for&lt;/code&gt; loop initializes &lt;code&gt;i&lt;/code&gt; to 0, executes until &lt;code&gt;i&lt;/code&gt; is less than 5, increments &lt;code&gt;i&lt;/code&gt; by 1 in each iteration, and skips the iteration when &lt;code&gt;i&lt;/code&gt; is equal to 2 using the &lt;code&gt;continue&lt;/code&gt; statement. In both loops, the current value of the loop variable is printed.&lt;/p&gt;
&lt;h2&gt;
  
  
  Array Manipulation
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;myNumbers&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;myNumbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"-----&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;numLanguages&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Language %d is %s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;myLanguages&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"-----&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;matrix&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;matrix&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="n"&gt;matrix&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;matrix&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"-----&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;matrix&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="cm"&gt;/*
4
-----
Language 1 is C
Language 2 is C++
Language 3 is Java
Language 4 is C#
Language 5 is PHP
Language 6 is Python
Language 7 is Ruby
Language 8 is JavaScript
Language 9 is Rust
Language 10 is Go
Language 11 is Swift
Language 12 is R
Language 13 is Kotlin
-----
2
5
*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;These code blocks demonstrate array manipulation. The first block prints the value of the first element in the &lt;code&gt;myNumbers&lt;/code&gt; array. The second block uses a &lt;code&gt;for&lt;/code&gt; loop to iterate over the &lt;code&gt;myLanguages&lt;/code&gt; array and prints each language's name along with its corresponding index. The third block initializes a 2-dimensional array called &lt;code&gt;matrix&lt;/code&gt; and prints the value at a specific index. It then modifies that value and prints it again. The final block uses nested &lt;code&gt;for&lt;/code&gt; loops to iterate over the &lt;code&gt;matrix&lt;/code&gt; array and print each element.&lt;/p&gt;
&lt;h2&gt;
  
  
  String Manipulation
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Osagie"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;strlen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%c&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="cm"&gt;/*
1
9
5
7
6
8
-----
O
s
a
g
i
e
*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This code block demonstrates string manipulation. It declares an integer variable &lt;code&gt;x&lt;/code&gt; and a character pointer &lt;code&gt;name&lt;/code&gt; that points to the string "Osagie". A &lt;code&gt;for&lt;/code&gt; loop is used to iterate over the characters in the &lt;code&gt;name&lt;/code&gt; string. It prints each character using the &lt;code&gt;%c&lt;/code&gt; format specifier.&lt;/p&gt;
&lt;h2&gt;
  
  
  Practice
&lt;/h2&gt;

&lt;p&gt;Assuming you &lt;a href="https://replit.com/signup" rel="noopener noreferrer"&gt;have an account&lt;/a&gt; or are already &lt;a href="https://replit.com/login" rel="noopener noreferrer"&gt;logged in&lt;/a&gt; on Replit.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://replit.com/@OsagieNoah/advanced#advanced.c" rel="noopener noreferrer"&gt;Try the Replit&lt;/a&gt; Editor online.&lt;/li&gt;
&lt;li&gt;Click the Fork button.&lt;/li&gt;
&lt;li&gt;Edit the current code.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@OsagieNoah/advanced?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this blog post, we went through a C code snippet step by step, explaining each part and its logic for beginners. We covered variable declarations, comparisons, conditionals, loops, array manipulation, and string manipulation. Understanding these fundamental concepts will help you in your journey to becoming a proficient C programmer.&lt;/p&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;Here are some reference links that can provide additional information and explanations on the topics covered in the blog:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Variables and Constants&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;C Variable Types: &lt;a href="https://www.geeksforgeeks.org/variables-in-c/" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Understanding Constants in C: &lt;a href="https://www.programiz.com/c-programming/c-variables-constants" rel="noopener noreferrer"&gt;Programiz&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Conditionals&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If-Else Statements: &lt;a href="https://www.geeksforgeeks.org/decision-making-c-c-else-nested-else/" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ternary Operator: &lt;a href="https://www.geeksforgeeks.org/conditional-or-ternary-operator-in-c/" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Switch Statements&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Switch Statement: &lt;a href="https://www.geeksforgeeks.org/switch-statement-cc/" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Loops&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;C Loops: &lt;a href="https://www.geeksforgeeks.org/c-loops/" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;While Loop: &lt;a href="https://www.geeksforgeeks.org/c-while-loop/?" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;C while and do...while Loop: &lt;a href="https://www.programiz.com/c-programming/c-do-while-loops" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Array Manipulation&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Arrays in C: &lt;a href="https://www.geeksforgeeks.org/arrays-in-c-cpp/" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;2D Arrays in C: &lt;a href="https://www.geeksforgeeks.org/multidimensional-arrays-in-c/" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;2D Arrays in C: &lt;a href="https://www.tutorialspoint.com/cprogramming/c_multi_dimensional_arrays.htm#:~:text=A%20two-dimensional%20array%20is%2C%20in%20essence%2C%20a%20list,type%20and%20arrayNamewill%20be%20a%20valid%20C%20identifier." rel="noopener noreferrer"&gt;Tutorials point&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;String Manipulation&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strings in C: &lt;a href="https://www.geeksforgeeks.org/strings-in-c-2/" rel="noopener noreferrer"&gt;GeeksforGeeks&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;String Functions: &lt;a href="https://www.programiz.com/c-programming/c-strings" rel="noopener noreferrer"&gt;Programiz&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These references should provide additional explanations and examples to enhance the understanding of the concepts covered in the blog post.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Happy Coding!&lt;/strong&gt;&lt;/p&gt;




</description>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>String Manipulation and User Input in C Programming</title>
      <dc:creator>Bello Osagie</dc:creator>
      <pubDate>Sun, 25 Jun 2023 01:54:52 +0000</pubDate>
      <link>https://dev.to/bello/string-manipulation-and-user-input-3fgm</link>
      <guid>https://dev.to/bello/string-manipulation-and-user-input-3fgm</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/techstackmedia/software-engineering-series/tree/16-string-manipulation-and-user-input" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fbizstak%2Fimage%2Fupload%2Fv1685060686%2Fgithub_f9ljwi.svg" alt="GitHub Logo" width="64" height="64"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In C programming, the &lt;code&gt;string.h&lt;/code&gt; library provides several functions for manipulating strings. This blog post will explore the usage of string manipulation functions in C, along with a detailed explanation of user input using &lt;code&gt;scanf&lt;/code&gt; and &lt;code&gt;fgets&lt;/code&gt;. We will analyze a code snippet that showcases these concepts and discuss each aspect of the code step by step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Snippet
&lt;/h2&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Including &lt;code&gt;string.h&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The first line of the code snippet &lt;code&gt;#include &amp;lt;string.h&amp;gt;&lt;/code&gt; is a preprocessor directive that includes the &lt;code&gt;string.h&lt;/code&gt; header file. This file contains function declarations for string manipulation, such as &lt;code&gt;strlen&lt;/code&gt;, &lt;code&gt;strcpy&lt;/code&gt;, &lt;code&gt;strcat&lt;/code&gt;, and &lt;code&gt;strcmp&lt;/code&gt;. By including this header file, we gain access to these functions, which we will utilize in the code snippet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a Directory
&lt;/h2&gt;

&lt;p&gt;To begin, let's create a file named &lt;code&gt;intermediate.c&lt;/code&gt; using the command line. Follow the instructions below based on your operating system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the command prompt or PowerShell.&lt;/li&gt;
&lt;li&gt;Run the following commands:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;basic-programming/c-programming
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Open the file in your favorite text editor.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;code intermediate.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vim intermediate.c &lt;span class="c"&gt;# installed by default on macOS&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;emacs &lt;span class="nt"&gt;-Q&lt;/span&gt; &lt;span class="nt"&gt;-nw&lt;/span&gt; intermediate.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano intermediate.c &lt;span class="c"&gt;# installed by default on Linux&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;:&lt;br&gt;
Make sure you save changes in the file.&lt;/p&gt;
&lt;h2&gt;
  
  
  String Manipulation using &lt;code&gt;string.h&lt;/code&gt; Functions
&lt;/h2&gt;

&lt;p&gt;In this section, we'll analyze the code related to string manipulation functions provided by the &lt;code&gt;string.h&lt;/code&gt; library.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="c1"&gt;// String Manipulation&lt;/span&gt;
&lt;span class="n"&gt;strcat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;firstText&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;secondText&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;strcpy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;secondStr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thirdStr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;str13Cmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;strcmp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;firstStr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;thirdStr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;str3greetingCmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;strcmp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;thirdStr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;greeting&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In the code above, we perform various string manipulation operations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;strcat(firstText, secondText);&lt;/code&gt;: This line uses the&lt;code&gt;strcat&lt;/code&gt;function to concatenate the&lt;code&gt;secondText&lt;/code&gt;string at the end of the&lt;code&gt;firstText&lt;/code&gt;string. The result is that the&lt;code&gt;firstText&lt;/code&gt; string becomes "Hello World!".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;strcpy(secondStr, thirdStr);&lt;/code&gt;: Here, we use the &lt;code&gt;strcpy&lt;/code&gt; function to copy the contents of the &lt;code&gt;thirdStr&lt;/code&gt; string into the &lt;code&gt;secondStr&lt;/code&gt; array. This operation creates an independent copy of the string.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;const int str13Cmp = strcmp(firstStr, thirdStr);&lt;/code&gt;: The &lt;code&gt;strcmp&lt;/code&gt; function compares the contents of the &lt;code&gt;firstStr&lt;/code&gt; and &lt;code&gt;thirdStr&lt;/code&gt; strings. It returns an integer value indicating the result of the comparison. If the two strings are equal, it returns 0. If &lt;code&gt;firstStr&lt;/code&gt; is lexicographically less than &lt;code&gt;thirdStr&lt;/code&gt;, it returns a negative value. If &lt;code&gt;firstStr&lt;/code&gt; is lexicographically greater than &lt;code&gt;thirdStr&lt;/code&gt;, it returns a positive value. The result is stored in the &lt;code&gt;str13Cmp&lt;/code&gt; variable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;const int str3greetingCmp = strcmp(thirdStr, greeting);&lt;/code&gt;: Similarly, this line compares the &lt;code&gt;thirdStr&lt;/code&gt; and &lt;code&gt;greeting&lt;/code&gt; strings using &lt;code&gt;strcmp&lt;/code&gt; and stores the result in the &lt;code&gt;str3greetingCmp&lt;/code&gt; variable.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  User Input using &lt;code&gt;scanf&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Now, let's look at the code related to user input using the &lt;code&gt;scanf&lt;/code&gt; function.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="c1"&gt;// User Input using scanf&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Please type your age and grade: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d %c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;myAge&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;myChar&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Please enter your first name: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%19s"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;myFirstName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In the code above, we use &lt;code&gt;scanf&lt;/code&gt; to retrieve user input:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;scanf("%d %c", &amp;amp;myAge, &amp;amp;myChar);&lt;/code&gt;: This line prompts the user to enter their age and grade. The format string &lt;code&gt;"%d %c"&lt;/code&gt; specifies that we expect an integer followed by a character as input. The &lt;code&gt;&amp;amp;&lt;/code&gt; operator is used to pass the memory addresses of &lt;code&gt;myAge&lt;/code&gt; and &lt;code&gt;myChar&lt;/code&gt; variables to store the values entered by the user.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;scanf("%19s", myFirstName);&lt;/code&gt;: This line prompts the user to enter their first name. The format string &lt;code&gt;"%19s"&lt;/code&gt; specifies that we expect a string input with a maximum length of 19 characters (to avoid buffer overflow). The entered string is stored in the &lt;code&gt;myFirstName&lt;/code&gt; character array.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  User Input using &lt;code&gt;fgets&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Here's the code that demonstrates user input using the &lt;code&gt;fgets&lt;/code&gt; function.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="c1"&gt;// User Input using fgets&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Please enter your full name: "&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;getchar&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  &lt;span class="c1"&gt;// Clear the newline character from the previous input&lt;/span&gt;
&lt;span class="n"&gt;fgets&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;myFullName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;myFullName&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;stdin&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;myFullName&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;strcspn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;myFullName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sc"&gt;'\0'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In the code above, we utilize &lt;code&gt;fgets&lt;/code&gt; to obtain user input:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;fgets(myFullName, sizeof(myFullName), stdin);&lt;/code&gt;: This line reads a line of input from the user, storing it in the &lt;code&gt;myFullName&lt;/code&gt; character array. The &lt;code&gt;sizeof(myFullName)&lt;/code&gt; argument specifies the maximum number of characters to read, preventing buffer overflow. The &lt;code&gt;stdin&lt;/code&gt; stream indicates that the input is read from the standard input (keyboard).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;myFullName[strcspn(myFullName, "\n")] = '\0';&lt;/code&gt;: Since &lt;code&gt;fgets&lt;/code&gt; captures the newline character (&lt;code&gt;\n&lt;/code&gt;) when the user presses Enter, this line removes the newline character from the &lt;code&gt;myFullName&lt;/code&gt; string by replacing it with a null character (&lt;code&gt;\0&lt;/code&gt;). This step ensures that the string ends at the intended input and doesn't include the newline character.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Memory Address and Pointers
&lt;/h2&gt;

&lt;p&gt;This section focuses on memory addresses and pointers used in the code.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Memory Address and Pointers&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"My age is: %d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;myAge&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"My character is: %c&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;myChar&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"My first name is: %s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;myFirstName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"My full name is: %s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;myFullName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%p&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;myAge&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%p&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;ptr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;ptr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In the code above, we work with memory addresses and pointers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;printf("My age is: %d\n", myAge);&lt;/code&gt;: This line displays the value of the &lt;code&gt;myAge&lt;/code&gt; variable, representing the age entered by the user.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;printf("My character is: %c\n", myChar);&lt;/code&gt;: Here, we print the value of the &lt;code&gt;myChar&lt;/code&gt; variable, which corresponds to the grade entered by the user.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;printf("My first name is: %s\n", myFirstName);&lt;/code&gt;: This line outputs the contents of the &lt;code&gt;myFirstName&lt;/code&gt; character array, which contains the user's first name.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;printf("My full name is: %s\n", myFullName);&lt;/code&gt;: Similarly, we display the content of the &lt;code&gt;myFullName&lt;/code&gt; character array, which holds the user's full name.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;printf("%p\n", (void*)&amp;amp;myAge);&lt;/code&gt;: This line prints the memory address of the &lt;code&gt;myAge&lt;/code&gt; variable using the &lt;code&gt;%p&lt;/code&gt; format specifier. The &lt;code&gt;&amp;amp;&lt;/code&gt; operator retrieves the address of the variable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;printf("%p\n", (void*)ptr);&lt;/code&gt;: Here, we print the memory address stored in the &lt;code&gt;ptr&lt;/code&gt; pointer variable. The &lt;code&gt;(void*)&lt;/code&gt; cast is used to ensure proper formatting of the memory address.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;printf("%d\n", *ptr);&lt;/code&gt;: This line dereferences the &lt;code&gt;ptr&lt;/code&gt; pointer and prints the value stored at the memory address it points to. Since &lt;code&gt;ptr&lt;/code&gt; points to &lt;code&gt;myAge&lt;/code&gt;, it effectively displays the value of &lt;code&gt;myAge&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;
Finally, the code snippet includes several &lt;code&gt;printf&lt;/code&gt; statements to display the output.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Output&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;alphabetLength&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;alphabetByte&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;firstText&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;secondStr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;str13Cmp&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;str3greetingCmp&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The code above produces the following output:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;alphabetLength&lt;/code&gt;: This line prints the length of the &lt;code&gt;alphabet&lt;/code&gt; string, which is determined using the &lt;code&gt;strlen&lt;/code&gt; function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;alphabetByte&lt;/code&gt;: Similarly, this line displays the size (in bytes) of the &lt;code&gt;alphabet&lt;/code&gt; array, obtained using the &lt;code&gt;sizeof&lt;/code&gt; operator.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;firstText&lt;/code&gt;: This line outputs the contents of the &lt;code&gt;firstText&lt;/code&gt; character array, which now contains the concatenated string "Hello World!".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;secondStr&lt;/code&gt;: Here, we print the contents of the &lt;code&gt;secondStr&lt;/code&gt; character array, which was assigned the value of the &lt;code&gt;thirdStr&lt;/code&gt; string using &lt;code&gt;strcpy&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;str13Cmp&lt;/code&gt;: This line displays the result of comparing the &lt;code&gt;firstStr&lt;/code&gt; and &lt;code&gt;thirdStr&lt;/code&gt; strings using &lt;code&gt;strcmp&lt;/code&gt;. It indicates whether the two strings are equal or different.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;str3greetingCmp&lt;/code&gt;: Similarly, this line shows the result of comparing the &lt;code&gt;thirdStr&lt;/code&gt; and &lt;code&gt;greeting&lt;/code&gt; strings using &lt;code&gt;strcmp&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Practive
&lt;/h2&gt;

&lt;p&gt;Assuming you &lt;a href="https://replit.com/signup" rel="noopener noreferrer"&gt;have an account&lt;/a&gt; or are already &lt;a href="https://replit.com/login" rel="noopener noreferrer"&gt;logged in&lt;/a&gt; on Replit.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://replit.com/@OsagieNoah/intermediate#intermediate.c" rel="noopener noreferrer"&gt;Try the Replit&lt;/a&gt; Editor online.&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Fork&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;Edit the current code.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@OsagieNoah/intermediate?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this blog post, we explored the usage of string manipulation functions provided by the &lt;code&gt;string.h&lt;/code&gt; library in C programming. We discussed functions such as &lt;code&gt;strlen&lt;/code&gt;, &lt;code&gt;strcpy&lt;/code&gt;, &lt;code&gt;strcat&lt;/code&gt;, and &lt;code&gt;strcmp&lt;/code&gt;, along with their purpose and how they are utilized in the code snippet. Additionally, we examined user input using &lt;code&gt;scanf&lt;/code&gt; and &lt;code&gt;fgets&lt;/code&gt;, which allow the program to receive input from the user. Finally, we covered memory addresses and pointers, highlighting their significance and demonstrating their usage in the code snippet.&lt;/p&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.studytonight.com/c/string-and-character-array.php" rel="noopener noreferrer"&gt;String and Character Array&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.studytonight.com/c/pointers-in-c.php" rel="noopener noreferrer"&gt;Introduction to C Pointers&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.studytonight.com/c/declaring-and-initializing-pointer.php" rel="noopener noreferrer"&gt;Using Pointers in C&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.geeksforgeeks.org/g-fact-11/?ref=lbp" rel="noopener noreferrer"&gt;What is return type of getchar(), fgetc() and getc()?&lt;/a&gt;&lt;/p&gt;

</description>
      <category>softwareengineering</category>
      <category>c</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Basics of C Programming: Data Types, Constants, Variables, and Arrays</title>
      <dc:creator>Bello Osagie</dc:creator>
      <pubDate>Tue, 20 Jun 2023 16:29:20 +0000</pubDate>
      <link>https://dev.to/bello/basics-of-c-programming-5ghm</link>
      <guid>https://dev.to/bello/basics-of-c-programming-5ghm</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/techstackmedia/software-engineering-series/tree/15-basics-of-c-programming" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fbizstak%2Fimage%2Fupload%2Fv1685060686%2Fgithub_f9ljwi.svg" alt="GitHub Logo" width="64" height="64"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Understanding the basics of C programming is essential for any aspiring programmer. In this blog post, we will explore the concept of data types and constants in C programming, taking a hands-on approach to deepen our understanding. We will compile and run the code snippets to observe the results firsthand. Let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Snippet
&lt;/h2&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
 
&lt;h2&gt;
  
  
  Creating a Directory
&lt;/h2&gt;

&lt;p&gt;To begin, let's create a file named &lt;code&gt;basics.c&lt;/code&gt; using the command line. Follow the instructions below based on your operating system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open the command prompt or PowerShell.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run the following commands:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;basic-programming/c-programming
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Open the file in your favorite text editor.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;code basics.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vim basics.c &lt;span class="c"&gt;# installed by default on macOS&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;emacs &lt;span class="nt"&gt;-Q&lt;/span&gt; &lt;span class="nt"&gt;-nw&lt;/span&gt; basics.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano basics.c &lt;span class="c"&gt;# installed by default on Linux&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; Make sure you save changes in the file.&lt;/p&gt;
&lt;h2&gt;
  
  
  Entry Point of a Program
&lt;/h2&gt;

&lt;p&gt;In C programming, &lt;code&gt;int main()&lt;/code&gt; or &lt;code&gt;int main(void)&lt;/code&gt; is the entry point of a C program. It is the function where the execution of the program starts. Here's an explanation of each:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Code goes here    &lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;int main()&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This declaration of &lt;code&gt;main&lt;/code&gt; specifies that the function takes an unspecified number of arguments.&lt;/li&gt;
&lt;li&gt;In C, if no arguments are specified in the parentheses, it is assumed that the function can accept any number of arguments.&lt;/li&gt;
&lt;li&gt;While this declaration is allowed by the C language, it is generally considered bad practice because it can lead to potential issues related to argument handling and type-checking.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;int main(void)&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This declaration of &lt;code&gt;main&lt;/code&gt; specifies that the function takes no arguments.&lt;/li&gt;
&lt;li&gt;By explicitly stating &lt;code&gt;(void)&lt;/code&gt; in the parentheses, it conveys that the &lt;code&gt;main&lt;/code&gt; function does not expect any input parameters.&lt;/li&gt;
&lt;li&gt;This declaration is considered good practice and is recommended for clarity and to avoid potential issues with argument handling.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using int &lt;code&gt;main(void)&lt;/code&gt; is generally considered better practice because it clearly indicates that the &lt;code&gt;main&lt;/code&gt; function does not accept any arguments. It helps in avoiding accidental mistakes related to argument passing and makes the code more readable and self-explanatory.&lt;/p&gt;
&lt;h2&gt;
  
  
  Exit Point of a Program
&lt;/h2&gt;

&lt;p&gt;In C programming, the &lt;code&gt;return 0&lt;/code&gt;; statement at the end of the &lt;code&gt;main&lt;/code&gt; function is not required, but it is commonly used. Here's an explanation:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Code goes here &lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;return&lt;/code&gt; statement is used to indicate the exit status of the program to the operating system or the program's caller.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;By convention, a return value of &lt;code&gt;0&lt;/code&gt; typically indicates successful execution or termination of the program.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the &lt;code&gt;return&lt;/code&gt; statement is omitted in the &lt;code&gt;main&lt;/code&gt; function, the C language automatically inserts an implicit &lt;code&gt;return 0&lt;/code&gt;; at the end of the function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Including an explicit &lt;code&gt;return 0;&lt;/code&gt; at the end of the &lt;code&gt;main&lt;/code&gt; function is considered good practice for the following reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It makes the code more readable and explicit, clearly indicating the intended termination of the program.&lt;/li&gt;
&lt;li&gt;It allows for consistency with other functions that may have non-zero return values to indicate specific error conditions.&lt;/li&gt;
&lt;li&gt;It ensures compatibility with some programming environments that may expect a return value from the &lt;code&gt;main&lt;/code&gt; function.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;While &lt;code&gt;return 0;&lt;/code&gt; is not strictly required, it is widely used and considered a best practice. It helps in writing clear and maintainable code, especially when working on larger projects or collaborating with other developers.&lt;/p&gt;
&lt;h2&gt;
  
  
  Data Types: Defining the Nature of Data
&lt;/h2&gt;

&lt;p&gt;Data types are used to define the type of data that a variable can hold. C provides several built-in data types, including integers, characters, booleans, and arrays. Let's explore these data types by examining the code snippet provided.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cm"&gt;/* Data Types */&lt;/span&gt;

&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;numb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;89&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Bello Osagie"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;isTrue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In the above code, we can identify three different data types being used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;int&lt;/code&gt; is used to store integer values. Here, &lt;code&gt;numb&lt;/code&gt; represents the number 89.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;char*&lt;/code&gt; (character pointer) is used to store strings. In this case, &lt;code&gt;str&lt;/code&gt; points to the string &lt;code&gt;Bello Osagie&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;bool&lt;/code&gt; represents boolean values (&lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;). The variable &lt;code&gt;isTrue&lt;/code&gt; is assigned the value &lt;code&gt;true&lt;/code&gt; because the expression &lt;code&gt;5 &amp;gt; 3&lt;/code&gt; evaluates to &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By utilizing different data types, we can handle various kinds of information in our programs.&lt;/p&gt;
&lt;h3&gt;
  
  
  Note
&lt;/h3&gt;

&lt;p&gt;These are not all the data types we have in C. We will explore others later.&lt;/p&gt;
&lt;h2&gt;
  
  
  Array: List of Characters as a String
&lt;/h2&gt;

&lt;p&gt;The code &lt;code&gt;char text[] = "This is a text";&lt;/code&gt; represents a character array, which is commonly used to store strings in C. In this case, the array &lt;code&gt;text&lt;/code&gt; is initialized with the string "This is a text".&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"This is a text"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Although it is common to use character arrays to store strings in C, it's important to note that there is no separate data type specifically for strings. Instead, strings are represented as arrays of characters terminated by a null character (&lt;code&gt;'\0'&lt;/code&gt;), indicating the end of the string.&lt;/p&gt;
&lt;h3&gt;
  
  
  Modification of a Character at a specific index
&lt;/h3&gt;

&lt;p&gt;Let's visually represent the interpretation of the given code below and explain the zero-indexed string, modification of the character at index 8, and the memory addresses before and after the modification:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"This is a text"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sc"&gt;'1'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Declaration and Initialization of the Character Array (String):
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"This is a text"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This code declares and initializes a character array &lt;code&gt;text&lt;/code&gt; with the string "This is a text". The characters of the string are stored in sequential memory locations.&lt;/p&gt;

&lt;p&gt;Visual representation:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="nl"&gt;Memory:&lt;/span&gt;
&lt;span class="o"&gt;-----------------------------------------------------&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;Address&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="n"&gt;Value&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;          &lt;span class="n"&gt;Variable&lt;/span&gt;           &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;-----------------------------------------------------&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1000&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'T'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'T'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1001&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'h'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'h'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1002&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'i'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'i'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1003&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'s'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'s'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1004&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;' '&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;' '&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1005&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'i'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'i'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1006&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'s'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'s'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1007&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;' '&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;' '&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1008&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'a'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'a'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1009&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;' '&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;' '&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1010&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'t'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'t'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1011&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'e'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'e'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1012&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'x'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'x'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1013&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'t'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'t'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1014&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="sc"&gt;'\0'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'\0'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;-----------------------------------------------------&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;2.) Modification of Character at Index 8:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sc"&gt;'1'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This code replaces the character at index 8 (zero-indexed) of &lt;code&gt;text&lt;/code&gt; with the character '1'.&lt;/p&gt;

&lt;p&gt;Visual representation (after modification):&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="nl"&gt;Memory:&lt;/span&gt;
&lt;span class="o"&gt;-----------------------------------------------------&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;Address&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="n"&gt;Value&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;          &lt;span class="n"&gt;Variable&lt;/span&gt;           &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;-----------------------------------------------------&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1000&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'T'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'T'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1001&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'h'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'h'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1002&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'i'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'i'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1003&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'s'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'s'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1004&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;' '&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;' '&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1005&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'i'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'i'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1006&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="sc"&gt;'s'&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'s'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1007&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;' '&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;' '&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1008&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'1'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'1'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1009&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;' '&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;' '&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1010&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'t'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'t'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1011&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'e'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'e'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1012&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'x'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'x'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1013&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="sc"&gt;'t'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'t'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1014&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="sc"&gt;'\0'&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'\0'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;-----------------------------------------------------&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In a zero-indexed string or array, the first element is accessed using index 0. So, in the given code, &lt;code&gt;text[8]&lt;/code&gt; represents the character at the ninth position in the string. By assigning &lt;code&gt;'1'&lt;/code&gt; to &lt;code&gt;text[8]&lt;/code&gt;, the original character &lt;code&gt;'a'&lt;/code&gt; at index 8 is replaced with &lt;code&gt;'1'&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The memory addresses before and after the modification remain the same, only the values stored at those addresses are changed. This is because the array &lt;code&gt;text&lt;/code&gt; is mutable, allowing us to modify its elements even if it is declared as a character array (string) or a constant.&lt;/p&gt;
&lt;h2&gt;
  
  
  Arrays: Storing Multiple Values
&lt;/h2&gt;

&lt;p&gt;Arrays allow for the storage of multiple values of the same data type. They provide a convenient way to group related data together. Let's analyze the usage of arrays in the code snippet.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;myNumbers&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt; &lt;span class="c1"&gt;// array&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;myString&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s"&gt;"money"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"people"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"love"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt; &lt;span class="c1"&gt;// array&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The code snippet demonstrates the declaration and initialization of two arrays, &lt;code&gt;myNumbers&lt;/code&gt; and &lt;code&gt;myString&lt;/code&gt;. &lt;code&gt;myNumbers&lt;/code&gt; is an array of integers, while &lt;code&gt;myString&lt;/code&gt; is an array of character pointers (strings).&lt;/p&gt;
&lt;h3&gt;
  
  
  Visual Representation of Array
&lt;/h3&gt;

&lt;p&gt;Let's visually represent the given code and explain the concept of zero-based indexing in arrays and strings:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Declaration and Initialization of Integer Array:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;myNumbers&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This code declares and initializes an integer array &lt;code&gt;myNumbers&lt;/code&gt; with 5 elements. The elements are initialized with the provided values.&lt;/p&gt;

&lt;p&gt;Visual representation:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="nl"&gt;myNumbers:&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;
&lt;span class="o"&gt;--------------&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;4&lt;/span&gt;  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="o"&gt;--------------&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;8&lt;/span&gt;  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="o"&gt;--------------&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1&lt;/span&gt;  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="o"&gt;--------------&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;9&lt;/span&gt;  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="o"&gt;--------------&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;7&lt;/span&gt;  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;span class="o"&gt;--------------&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In C and many programming languages, arrays are zero-based indexed. It means that the index of the first element in the array is 0, the second element is 1, and so on. In the &lt;code&gt;myNumbers&lt;/code&gt; array, the values are accessed as follows:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;myNumbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;span class="n"&gt;myNumbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;
&lt;span class="n"&gt;myNumbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="n"&gt;myNumbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;
&lt;span class="n"&gt;myNumbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;2.) Declaration and Initialization of String Array:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;myString&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s"&gt;"money"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"people"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"love"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This code declares and initializes a string array &lt;code&gt;myString&lt;/code&gt; with 3 elements. Each element is a pointer to a string literal.&lt;/p&gt;

&lt;p&gt;Visual representation:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="nl"&gt;myString:&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;
&lt;span class="o"&gt;--------------&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="s"&gt;"money"&lt;/span&gt;  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="o"&gt;--------------&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="s"&gt;"people"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="o"&gt;--------------&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="s"&gt;"love"&lt;/span&gt;  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="o"&gt;--------------&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Similarly, in C, strings are also represented as arrays of characters. Each character in a string has its index starting from 0. In the &lt;code&gt;myString&lt;/code&gt; array, the values are accessed as follows:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;myString&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"money"&lt;/span&gt;
&lt;span class="n"&gt;myString&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"people"&lt;/span&gt;
&lt;span class="n"&gt;myString&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"love"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Remember that the index represents the position of an element in the array or a character in a string, starting from 0.&lt;/p&gt;

&lt;p&gt;Zero-based indexing is a convention used in programming languages, and it provides a consistent and efficient way to access elements in arrays and strings. Starting the index at 0 aligns with the underlying memory representation and allows for simple arithmetic operations when working with array elements.&lt;/p&gt;
&lt;h2&gt;
  
  
  Constants: Immutable Values
&lt;/h2&gt;

&lt;p&gt;In C programming, constants are fixed values that cannot be modified during the execution of a program. They are declared using the &lt;code&gt;const&lt;/code&gt; keyword. Let's examine the usage of constants in our code.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cm"&gt;/* Constants */&lt;/span&gt;

&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;numb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;89&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Bello Osagie"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;isTrue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"This is a text"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sc"&gt;'1'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;greetings&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="sc"&gt;'H'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'e'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'l'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'l'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'o'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;' '&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'W'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'o'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'r'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'l'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'d'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'\0'&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;myNumbers&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt; &lt;span class="c1"&gt;// array&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;myString&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s"&gt;"money"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"people"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"love"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt; &lt;span class="c1"&gt;// array&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;indexNumb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;myNumbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;indexStr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;myString&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;myNumbers2D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;indexMyNumber2D&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;myNumbers2D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;replaceIndexMyNumber2D&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;myNumbers2D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;replaceIndexMyNumber2D&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The constant &lt;code&gt;numb&lt;/code&gt; is declared as an integer with the value 89. Since it is defined as a constant, its value cannot be changed later in the program. Similarly, &lt;code&gt;str&lt;/code&gt; is declared as a constant character pointer pointing to the string &lt;code&gt;Bello Osagie&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The boolean constant &lt;code&gt;isTrue&lt;/code&gt; is assigned the result of the expression &lt;code&gt;5 &amp;gt; 3&lt;/code&gt;, which evaluates to &lt;code&gt;true&lt;/code&gt;. Again, as a constant, its value remains unchanged.&lt;/p&gt;

&lt;p&gt;The array &lt;code&gt;greetings&lt;/code&gt; is initialized with the characters &lt;code&gt;'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd'&lt;/code&gt;, and &lt;code&gt;'\0'&lt;/code&gt;, representing a null-terminated string constant.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;myNumbers&lt;/code&gt; and &lt;code&gt;myString&lt;/code&gt; are arrays of integers and character pointers, respectively. These arrays are initialized with fixed values and cannot be modified later.&lt;/p&gt;

&lt;p&gt;Next, we have the 2D array &lt;code&gt;myNumbers2D&lt;/code&gt;, which is initialized with two rows and three columns of integers.&lt;/p&gt;

&lt;p&gt;We have variables such as &lt;code&gt;indexNumb&lt;/code&gt; and &lt;code&gt;indexStr&lt;/code&gt;, which store specific elements from the constant arrays.&lt;/p&gt;

&lt;p&gt;Finally, we have the variable &lt;code&gt;replaceIndexMyNumber2D&lt;/code&gt; which initially holds the value of &lt;code&gt;myNumbers2D[1][0]&lt;/code&gt; and later gets reassigned to the value &lt;code&gt;10&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Constants in Array
&lt;/h3&gt;

&lt;p&gt;Let's visually represent the interpretation of the given code and the output after the modification. Then, I will explain why the changes in the array elements are possible despite using &lt;code&gt;const&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;indexMyNumber2D&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;myNumbers2D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;replaceIndexMyNumber2D&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;indexMyNumber2D&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;replaceIndexMyNumber2D&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;1.) Declaration and Initialization of 2D Array:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;const int myNumbers2D[2][3] &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; 
    &lt;span class="o"&gt;{&lt;/span&gt;3, 5, 8&lt;span class="o"&gt;}&lt;/span&gt;,
    &lt;span class="o"&gt;{&lt;/span&gt;3, 0, 1&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This code declares and initializes a 2D array &lt;code&gt;myNumbers2D&lt;/code&gt; with 2 rows and 3 columns. The array elements are initialized with the provided values.&lt;/p&gt;

&lt;p&gt;Visual representation:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;myNumbers2D:
&lt;span class="nt"&gt;--------------&lt;/span&gt;
| 3 | 5 | 8 |
&lt;span class="nt"&gt;--------------&lt;/span&gt;
| 3 | 0 | 1 |
&lt;span class="nt"&gt;--------------&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;2.) Accessing Element of the 2D Array:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;const int indexMyNumber2D &lt;span class="o"&gt;=&lt;/span&gt; myNumbers2D[1][0]&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This code assigns the value at the index &lt;code&gt;[1][0]&lt;/code&gt; of &lt;code&gt;myNumbers2D&lt;/code&gt; to the constant variable &lt;code&gt;indexMyNumber2D&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Visual representation (after this step):&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;myNumbers2D:
&lt;span class="nt"&gt;--------------&lt;/span&gt;
| 3 | 5 | 8 |
&lt;span class="nt"&gt;--------------&lt;/span&gt;
| 3 | 0 | 1 |
&lt;span class="nt"&gt;--------------&lt;/span&gt;
indexMyNumber2D: 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;3.) Assignment of Element to a Non-constant Variable:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;int replaceIndexMyNumber2D &lt;span class="o"&gt;=&lt;/span&gt; myNumbers2D[1][0]&lt;span class="p"&gt;;&lt;/span&gt;
replaceIndexMyNumber2D &lt;span class="o"&gt;=&lt;/span&gt; 10&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This code assigns the value at the index &lt;code&gt;[1][0]&lt;/code&gt; of &lt;code&gt;myNumbers2D&lt;/code&gt; to the variable &lt;code&gt;replaceIndexMyNumber2D&lt;/code&gt;. Then, it reassigns the value of &lt;code&gt;replaceIndexMyNumber2D&lt;/code&gt; to &lt;code&gt;10&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Visual representation (after this step):&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;myNumbers2D:
&lt;span class="nt"&gt;--------------&lt;/span&gt;
| 3 | 5 | 8 |
&lt;span class="nt"&gt;--------------&lt;/span&gt;
| 3 | 0 | 1 |
&lt;span class="nt"&gt;--------------&lt;/span&gt;
indexMyNumber2D: 3
replaceIndexMyNumber2D: 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Even though the array &lt;code&gt;myNumbers2D&lt;/code&gt; is declared as &lt;code&gt;const&lt;/code&gt;, the changes in the array elements are possible because the &lt;code&gt;const&lt;/code&gt; qualifier applies to the elements themselves, not to the variables that hold them. The &lt;code&gt;const&lt;/code&gt; keyword ensures that the elements cannot be modified through the array variable &lt;code&gt;myNumbers2D&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In memory, the array &lt;code&gt;myNumbers2D&lt;/code&gt; is stored as a contiguous block. Each element in the array has its address. When you assign an element to a non-constant variable, like &lt;code&gt;replaceIndexMyNumber2D&lt;/code&gt;, the value of that element is copied to the variable, including its address. The variable &lt;code&gt;replaceIndexMyNumber2D&lt;/code&gt; now holds the value and the address of the element.&lt;/p&gt;

&lt;p&gt;When you modify the value of &lt;code&gt;replaceIndexMyNumber2D&lt;/code&gt;, you are changing the value stored at the address held by the variable. However, the original array elements in &lt;code&gt;myNumbers2D&lt;/code&gt; remains unchanged. The modification only affects the variable &lt;code&gt;replaceIndexMyNumber2D&lt;/code&gt; and its associated memory location.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;indexMyNumber2D&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;myNumbers2D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;replaceIndexMyNumber2D&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;indexMyNumber2D&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// myNumbers2D[1][0];&lt;/span&gt;
&lt;span class="n"&gt;replaceIndexMyNumber2D&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Visual representation (address illustration):&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="nl"&gt;Memory:&lt;/span&gt;
&lt;span class="o"&gt;---------------------------------------------------&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;Address&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="n"&gt;Value&lt;/span&gt;  &lt;span class="o"&gt;|&lt;/span&gt;           &lt;span class="n"&gt;Variable&lt;/span&gt;          &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;---------------------------------------------------&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1000&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="mi"&gt;3&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;myNumbers2D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1004&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="mi"&gt;5&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;myNumbers2D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1008&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="mi"&gt;8&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;myNumbers2D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1012&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="mi"&gt;3&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;myNumbers2D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1016&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="mi"&gt;0&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;myNumbers2D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1020&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="mi"&gt;1&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;myNumbers2D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1024&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;    &lt;span class="mi"&gt;3&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;indexMyNumber2D&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;  &lt;span class="mi"&gt;1028&lt;/span&gt;   &lt;span class="o"&gt;|&lt;/span&gt;   &lt;span class="mi"&gt;10&lt;/span&gt;    &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;replaceIndexMyNumber2D&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;---------------------------------------------------&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In this illustration, the addresses and values of the variables are shown in memory. The &lt;code&gt;const&lt;/code&gt; variables (&lt;code&gt;myNumbers2D&lt;/code&gt;, &lt;code&gt;indexMyNumber2D&lt;/code&gt;) hold the original values without any modifications. The non-constant variable &lt;code&gt;replaceIndexMyNumber2D&lt;/code&gt; holds the modified value.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;indexMyNumber2D&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;myNumbers2D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;replaceIndexMyNumber2D&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;indexMyNumber2D&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// myNumbers2D[1][0];&lt;/span&gt;
&lt;span class="n"&gt;replaceIndexMyNumber2D&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Printing the Values: Printing Formatted Output
&lt;/h2&gt;

&lt;p&gt;To observe the values of the variables and constants in our code, we use the &lt;code&gt;printf&lt;/code&gt; function to print them to the console (terminal). Here's how the values are printed:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cm"&gt;/* Printing Values */&lt;/span&gt;

&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;numb&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Print the value of numb&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Print the value of text&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Print the value of str&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Print the value of text&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;isTrue&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Print the value of isTrue&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;indexNumb&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Print the value of indexNumb&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;greetings&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Print the value of greetings&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%s&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;indexStr&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Print the value of indexStr&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;indexMyNumber2D&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Print the value of indexMyNumber2D&lt;/span&gt;
&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;replaceIndexMyNumber2D&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Print the value of replaceIndexMyNumber2D&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Each &lt;code&gt;printf&lt;/code&gt; statement specifies a format specifier to indicate the data type of the variable or constant being printed. For example, &lt;code&gt;%d&lt;/code&gt; is used to print integers, &lt;code&gt;%s&lt;/code&gt; is used to print strings, and &lt;code&gt;%d&lt;/code&gt; is also used for booleans (where &lt;code&gt;true&lt;/code&gt; is printed as &lt;code&gt;1&lt;/code&gt; and &lt;code&gt;false&lt;/code&gt; is printed as &lt;code&gt;0&lt;/code&gt;).&lt;/p&gt;
&lt;h3&gt;
  
  
  Note
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;%d&lt;/code&gt; is the same as &lt;code&gt;%i&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The format specifier &lt;code&gt;%c&lt;/code&gt; is used to print a single character in C. However, the value representing the character must be enclosed in single quotes (' '), not backticks. Below is an example:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%c&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sc"&gt;'J'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// A char&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This will print the character &lt;code&gt;'J'&lt;/code&gt; to the console followed by a newline character (&lt;code&gt;'\n'&lt;/code&gt;).&lt;/p&gt;
&lt;h2&gt;
  
  
  Comments: Documenting Your Code
&lt;/h2&gt;

&lt;p&gt;Comments are essential for code documentation. They provide information about the code's functionality, purpose, and any other relevant details. In the given code snippet, we can see the usage of comments to document the code. Let's take a look:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="c1"&gt;// This is a single-line comment&lt;/span&gt;
&lt;span class="cm"&gt;/* 
   This is a multi-line comment
   It can span multiple lines
*/&lt;/span&gt;

&lt;span class="c1"&gt;// Code snippet starts here&lt;/span&gt;

&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;numb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;89&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Variable to store a number&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Bello Osagie"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Variable to store a string&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;isTrue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Variable to store a boolean value&lt;/span&gt;

&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"This is a text"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Variable to store a character array&lt;/span&gt;

&lt;span class="c1"&gt;// Code snippet ends here&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In the code snippet, we can see the use of single-line comments and multi-line comments. Single-line comments start with &lt;code&gt;//&lt;/code&gt; and continue until the end of the line. They are used to provide brief explanations or comments on a specific line of code.&lt;/p&gt;

&lt;p&gt;Multi-line comments start with &lt;code&gt;/*&lt;/code&gt; and end with &lt;code&gt;*/&lt;/code&gt;. They can span multiple lines and are useful for providing detailed explanations or commenting out a block of code.&lt;/p&gt;

&lt;p&gt;Comments are not executed as part of the program and do not affect the program's functionality. They are solely meant for human readability and understanding.&lt;/p&gt;
&lt;h2&gt;
  
  
  Variables: Storing Data
&lt;/h2&gt;

&lt;p&gt;Variables are used to store and manipulate data in C programming. They act as containers that hold values of different types. In the given code snippet, we can see the usage of variables like &lt;code&gt;numb&lt;/code&gt;, &lt;code&gt;str&lt;/code&gt;, &lt;code&gt;isTrue&lt;/code&gt;, &lt;code&gt;text&lt;/code&gt;, and more. Let's explore their significance and how they are utilized.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cm"&gt;/* variables */&lt;/span&gt;

&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;numb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;89&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Bello Osagie"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;isTrue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"This is a text"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In this code, &lt;code&gt;numb&lt;/code&gt; is an integer variable assigned a constant value of &lt;code&gt;89&lt;/code&gt;. We use the &lt;code&gt;const&lt;/code&gt; keyword to indicate that the value is constant and cannot be modified.&lt;/p&gt;

&lt;p&gt;Similarly, &lt;code&gt;str&lt;/code&gt; is a character pointer variable storing the address of the string &lt;code&gt;Bello Osagie&lt;/code&gt;. The &lt;code&gt;const&lt;/code&gt; keyword ensures that the pointer itself is constant and cannot be used to modify the string.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;isTrue&lt;/code&gt; is a boolean variable assigned the result of the expression &lt;code&gt;5 &amp;gt; 3&lt;/code&gt;. It will hold the value &lt;code&gt;true&lt;/code&gt; since the expression is true.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;text&lt;/code&gt; is a character array initialized with the string &lt;code&gt;"This is a text."&lt;/code&gt; It allows for the manipulation of individual characters within the array.&lt;/p&gt;
&lt;h2&gt;
  
  
  Modifying Variables: Adding and Replacing Values
&lt;/h2&gt;

&lt;p&gt;Variables can be modified by assigning new values to them. In the code snippet, we can see examples of modifying variables:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sc"&gt;'1'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;replaceIndexMyNumber2D&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The statement &lt;code&gt;text[8] = '1'&lt;/code&gt; replaces the character at index 8 in the text array with the character &lt;code&gt;'1'&lt;/code&gt;. Similarly, &lt;code&gt;replaceIndexMyNumber2D = 10&lt;/code&gt; assigns the value 10 to the variable &lt;code&gt;replaceIndexMyNumber2D&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Compiling and Running the Code
&lt;/h2&gt;

&lt;p&gt;When compiling a C program using the GCC compiler, you can pass various options and flags to modify the behavior of the compilation process. Let's break down the options used in the commands you mentioned:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cm"&gt;/*
 * Run:
 * gcc -Wall -pedantic -Werror -Wextra -std=c99 basics.c -o basics
 * gcc basics.c -o basics
 * ./basics
 */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Let's discuss each option:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-Wall&lt;/code&gt;: Enables compiler warnings for potential issues in the code. It stands for &lt;strong&gt;all warnings&lt;/strong&gt;. When this option is used, the compiler will display a comprehensive set of warning messages to help identify possible problems in the code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-pedantic&lt;/code&gt;: Enforces strict adherence to the C language standards. It instructs the compiler to be pedantic and only allows code that strictly follows the C standard. It disables certain language extensions and non-standard features.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-Werror&lt;/code&gt;: Treats all warnings as errors. When this option is enabled, any warning generated by the compiler will be treated as an error, causing the compilation to fail. This ensures that the code is warning-free and encourages developers to write clean and error-free code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-Wextra&lt;/code&gt;: Enables additional warning messages beyond those enabled by &lt;code&gt;-Wall&lt;/code&gt;. It provides extra warnings for potentially suspicious code constructs or common programming mistakes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;-std=c99&lt;/code&gt;: Specifies the C language standard to be used. In this case, it specifies the C99 standard. C99 is an ANSI/ISO standard for the C programming language, introduced in 1999. It adds several new features and improvements to the language.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first command (&lt;code&gt;gcc -Wall -pedantic -Werror -Wextra -std=c99 basics.c -o basics&lt;/code&gt;) enables strict warnings, treats warnings as errors, and enforces adherence to the &lt;strong&gt;C99 standard&lt;/strong&gt;. It is advisable to use this command during development or when aiming for strict code quality and adherence to standards. It helps catch potential issues and encourages cleaner code.&lt;/p&gt;

&lt;p&gt;The second command (&lt;code&gt;gcc basics.c -o basics&lt;/code&gt;) is a simpler command that compiles the &lt;code&gt;basics.c&lt;/code&gt; file without any specific warning options or standard enforcement. It can be used for quick compilation without strict warning checks. However, it's generally recommended to use the first command during development or in projects where code quality and adherence to standards are crucial.&lt;/p&gt;

&lt;p&gt;By using the first command, you can catch and address potential issues early in the development process, leading to more robust and maintainable code.&lt;/p&gt;
&lt;h2&gt;
  
  
  Preprocessor Directives
&lt;/h2&gt;

&lt;p&gt;In the code below, &lt;code&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/code&gt; and &lt;code&gt;#include &amp;lt;stdbool.h&amp;gt;&lt;/code&gt; are preprocessor directives that include the standard C library headers &lt;code&gt;stdio.h&lt;/code&gt; and &lt;code&gt;stdbool.h&lt;/code&gt;, respectively. Here's an explanation of each:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdbool.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This directive includes the standard input/output library header. It provides functions for input and output operations, such as reading from or writing to the console or files.&lt;/li&gt;
&lt;li&gt;It allows you to use functions like &lt;code&gt;printf()&lt;/code&gt; and &lt;code&gt;scanf()&lt;/code&gt; for formatted output and input operations, respectively.&lt;/li&gt;
&lt;li&gt;In the given code, &lt;code&gt;printf()&lt;/code&gt; function is used to print values to the console.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;#include &amp;lt;stdbool.h&amp;gt;&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This directive includes the header for the C99 standard's Boolean type support.&lt;/li&gt;
&lt;li&gt;It defines the &lt;code&gt;bool&lt;/code&gt; type, which represents boolean values (&lt;code&gt;true&lt;/code&gt; and &lt;code&gt;false&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;In the given code, &lt;code&gt;bool&lt;/code&gt; is used to declare the variable isTrue and store a boolean value (true or false).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Including these headers is necessary to access the functions and definitions provided by the respective libraries. Without including &lt;code&gt;stdio.h&lt;/code&gt;, you wouldn't be able to use functions like &lt;code&gt;printf()&lt;/code&gt;, and without including &lt;code&gt;stdbool.h&lt;/code&gt;, you wouldn't be able to use the &lt;code&gt;bool&lt;/code&gt; data type.&lt;/p&gt;
&lt;h2&gt;
  
  
  Practice
&lt;/h2&gt;

&lt;p&gt;Assuming you &lt;a href="https://replit.com/signup" rel="noopener noreferrer"&gt;have an account&lt;/a&gt; or are already &lt;a href="https://replit.com/login" rel="noopener noreferrer"&gt;logged in&lt;/a&gt; on Replit.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://replit.com/@OsagieNoah/Basics#basics.c" rel="noopener noreferrer"&gt;Try the Replit&lt;/a&gt; Editor online.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click the &lt;strong&gt;Fork&lt;/strong&gt; button.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Edit the current code.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@OsagieNoah/Basics?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this blog post, we explored the basics of C programming by examining data types and constants. We learned how to declare and initialize variables and constants of various data types, including integers, characters, booleans, and arrays. We also observed the results by printing the values using &lt;code&gt;printf&lt;/code&gt;. Understanding these fundamental concepts is crucial for building more complex C programs. Stay tuned for future blog posts where we will delve deeper into C programming.&lt;/p&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.learn-c.org/data-types" rel="noopener noreferrer"&gt;C Data Types&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.learn-c.org/constants" rel="noopener noreferrer"&gt;C Constants&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.learn-c.org/arrays" rel="noopener noreferrer"&gt;C Arrays&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.learn-c.org/boolean" rel="noopener noreferrer"&gt;C Boolean Data Type&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.learn-c.org/printf" rel="noopener noreferrer"&gt;C printf Function&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Happy Coding!!!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>c</category>
      <category>softwareengineering</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Getting Started with C Programming: Compiling Programs</title>
      <dc:creator>Bello Osagie</dc:creator>
      <pubDate>Sun, 18 Jun 2023 19:06:05 +0000</pubDate>
      <link>https://dev.to/bello/getting-started-with-c-programming-2amd</link>
      <guid>https://dev.to/bello/getting-started-with-c-programming-2amd</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/techstackmedia/software-engineering-series/tree/14-getting-started-with-c-programming" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fbizstak%2Fimage%2Fupload%2Fv1685060686%2Fgithub_f9ljwi.svg" alt="GitHub Logo" width="64" height="64"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;C programming is a versatile language that allows you to build a wide range of applications. Whether you're a beginner or an experienced programmer, you must know how to set up your development environment and start with basic programming tasks. In this guide, we'll walk you through the process of creating directories and checking for the installation of C on different operating systems. We'll also cover the steps to install C if it's not already available. Finally, we'll demonstrate how to write and compile a simple &lt;strong&gt;&lt;code&gt;Hello, World!&lt;/code&gt;&lt;/strong&gt; program in C. Let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Snippet
&lt;/h2&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Installing Choco
&lt;/h2&gt;

&lt;p&gt;If this is not your first time using Chocolatey or Chocolatey is already installed on your Windows Operating System skip this section.&lt;/p&gt;

&lt;p&gt;To install Chocolatey, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search for PowerShell and run it as an administrator on Windows.&lt;/li&gt;
&lt;li&gt;Go to the Chocolatey &lt;a href="https://chocolatey.org/install" rel="noopener noreferrer"&gt;installation page&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If this is your first time installing Chocolatey on your operating system, execute the following command in your terminal, based on the instructions provided on the installation page:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Get-ExecutionPolicy&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;If the output is "Restricted", enter one of the commands below:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Set-ExecutionPolicy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;AllSigned&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Set-ExecutionPolicy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Bypass&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Scope&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Process&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Regardless of whether "Restricted" was the previous output or not, run the following command (copy and paste it into your terminal):
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Set-ExecutionPolicy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Bypass&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Scope&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Process&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Force&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;System.Net.ServicePointManager&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="n"&gt;SecurityProtocol&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;System.Net.ServicePointManager&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="n"&gt;SecurityProtocol&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-bor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;3072&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;iex&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;New-Object&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;System.Net.WebClient&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;DownloadString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://community.chocolatey.org/install.ps1'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;If there are no errors, check if Chocolatey was successfully installed by running the following command:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If the output displays the version of Chocolatey you are using, it means the installation was successful.&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating a Directory
&lt;/h2&gt;

&lt;p&gt;To begin, let's create a directory named &lt;code&gt;c-programming&lt;/code&gt; using the command line. Follow the instructions below based on your operating system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the command prompt or PowerShell.&lt;/li&gt;
&lt;li&gt;Run the following commands:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;basic-programming
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;basic-programming/c-programming
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;change directory to &lt;code&gt;c-programming&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;basic-programming/c-programming
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Checking if C is Installed
&lt;/h2&gt;

&lt;p&gt;Before you start writing C programs, it's important to check if C is installed on your system. You can verify this by using the &lt;code&gt;gcc&lt;/code&gt; or &lt;code&gt;cc&lt;/code&gt; command, a popular C compiler. Follow the steps below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the terminal.&lt;/li&gt;
&lt;li&gt;Run the following command:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;You may also include the extension to &lt;code&gt;gcc&lt;/code&gt;. That is &lt;code&gt;gcc&lt;/code&gt; is the same as &lt;code&gt;gcc.exe&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc.exe &lt;span class="nt"&gt;--version&lt;/span&gt;
gcc.exe input.c &lt;span class="nt"&gt;-o&lt;/span&gt; output.exe &lt;span class="c"&gt;# optionally omit the .exe&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If C is installed, the version information will be displayed. Otherwise, you may be prompted to install the necessary tools or package. For example, for Linux, if &lt;code&gt;gcc&lt;/code&gt; is not installed, running &lt;code&gt;gcc --version&lt;/code&gt; in the terminal typically results in an error message like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;The program &lt;span class="s1"&gt;'gcc'&lt;/span&gt; is currently not installed. You can &lt;span class="nb"&gt;install &lt;/span&gt;it by typing:
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;gcc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;For Windows, the error may look like this shown below:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="s1"&gt;'gcc'&lt;/span&gt; is not recognized as an internal or external &lt;span class="nb"&gt;command&lt;/span&gt;, operable program or batch file.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;For macOS, the error may look like this shown below:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nt"&gt;-bash&lt;/span&gt;: gcc: &lt;span class="nb"&gt;command &lt;/span&gt;not found
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;gcc&lt;/code&gt; or &lt;code&gt;cc&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In the article, the &lt;code&gt;gcc&lt;/code&gt; command will be primarily used for checking the version of the C compiler and compiling C programs. However, it is worth noting that &lt;code&gt;cc&lt;/code&gt; can be used as an alternative to &lt;code&gt;gcc&lt;/code&gt; for the same purposes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;While &lt;code&gt;gcc&lt;/code&gt; is commonly used as the command-line interface to the GNU Compiler Collection, including the C compiler, &lt;code&gt;cc&lt;/code&gt; is often set as a symbolic link or alias to &lt;code&gt;gcc&lt;/code&gt;. Therefore, both commands essentially serve the same purpose and can be used interchangeably in most cases.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The choice between using &lt;code&gt;gcc&lt;/code&gt; or &lt;code&gt;cc&lt;/code&gt; may depend on personal preference or specific system configurations. However, in the context of the article, it is safe to assume that the &lt;code&gt;gcc&lt;/code&gt; command will be predominantly used while acknowledging that the cc command could be used as an alternative.&lt;/p&gt;
&lt;h2&gt;
  
  
  Installing C
&lt;/h2&gt;

&lt;p&gt;If C is not installed on your system, follow the appropriate instructions based on your operating system:&lt;/p&gt;
&lt;h3&gt;
  
  
  General Installation (VSCode)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If you prefer to use VSCode, you can &lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;install it&lt;/a&gt; by using a package manager specific to your operating system. For Windows, you can use Chocolatey by running the command &lt;code&gt;choco install vscode&lt;/code&gt;. macOS users can use brew with the command &lt;code&gt;brew install --cask visual-studio-code&lt;/code&gt;. Ubuntu users can use sudo with the command &lt;code&gt;sudo apt install code&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After installing VSCode, you should install the following extensions: &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools-extension-pack" rel="noopener noreferrer"&gt;C/C++ Extension Pack&lt;/a&gt; and &lt;a href="https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner" rel="noopener noreferrer"&gt;Code Runner&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After the installation is complete, you can launch Visual Studio Code by searching for it in the applications menu or by running the &lt;code&gt;code&lt;/code&gt; command in the terminal (&lt;code&gt;code&lt;/code&gt; and click &lt;code&gt;Enter&lt;/code&gt; or &lt;code&gt;Return&lt;/code&gt;).&lt;br&gt;
Once Code Runner is installed, you will see a play icon beside which is a dropdown.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on the play dropdown icon. See the image below:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm12c6oozcs2ynaeaxtrg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm12c6oozcs2ynaeaxtrg.png" alt="A Snapshot Showing How to Run C with VSCode Code Runner Extension" width="800" height="236"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the terminal by pressing &lt;code&gt;Ctrl + J&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click the option that says &lt;strong&gt;Run C/C++&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffqv66p5pt8c9duecuuog.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffqv66p5pt8c9duecuuog.png" alt="run C with VSCode Code runner extension" width="800" height="177"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;From the debug configuration options, select the option to build and debug an active file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0kp20mgbcy78ounke5ls.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0kp20mgbcy78ounke5ls.png" alt="build and run in C" width="800" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will see the result &lt;code&gt;Hello, World!&lt;/code&gt; In your terminal. Notice the new executable file created during execution - &lt;code&gt;hello.exe&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note that the Keyboard shortcut is &lt;code&gt;Ctrl + Shift + B&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fenivsygnbmx4jykexu1q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fenivsygnbmx4jykexu1q.png" alt="C executable file in vscode" width="800" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that you have done the configuration, the next time you want to run a C program just click on the play button or use the keyboard shortcut &lt;code&gt;Ctrl + Alt + N&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13pfq91ln5vjf9ofs2lm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13pfq91ln5vjf9ofs2lm.png" alt="run executable file using the play button" width="800" height="247"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Issue
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If the installation doesn't work for you, go to the VS Code download page and click the download button based on your operating system - macOS, Linux, Windows and install (click on the executable file after download - accept all default settings).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the problem persists, &lt;a href="https://www.codeblocks.org/downloads/" rel="noopener noreferrer"&gt;download and install Codeblocks&lt;/a&gt;. You may navigate to the &lt;a href="https://www.codeblocks.org/downloads/binaries/" rel="noopener noreferrer"&gt;Binary releases page&lt;/a&gt; and download based on your operating system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Alternatively, use the &lt;a href="https://replit.com/@OsagieNoah/getting-started#main.c" rel="noopener noreferrer"&gt;online Replit text editor&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: You can also &lt;a href="https://vscode.dev" rel="noopener noreferrer"&gt;try VSCode in the browser&lt;/a&gt; and still follow along the course.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  macOS
&lt;/h3&gt;

&lt;p&gt;On macOS, Homebrew can be used to install C-related tools and libraries. However, Homebrew itself is not specifically used to install the C language since macOS already includes the Clang compiler, which supports C. Here's how you can install Homebrew and verify the availability of Clang:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the terminal.&lt;/li&gt;
&lt;li&gt;Install Homebrew by running the following command:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On macOS, brew might be pre-installed on your system, verify by running the command below:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If it is not installed or it shows an error, run the command below:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/bin/bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;After Homebrew is installed, you can install additional C-related tools and libraries if needed by using Homebrew commands. For example, to install the GNU Compiler Collection (GCC), you can run the following command:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;gcc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;To verify the availability of Clang, which comes preinstalled on macOS, run the following command:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;clang &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Remember, on macOS, the default compiler is Clang, which supports C and other programming languages. If you install GCC using Homebrew, you can use it as an alternative to Clang.&lt;/p&gt;
&lt;h4&gt;
  
  
  Alternative installation on macOS
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Install Xcode from the App Store.&lt;/li&gt;
&lt;li&gt;Open Xcode and navigate to Preferences.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Downloads&lt;/strong&gt; tab, install the Command Line Tools.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Ubuntu
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Open the terminal.&lt;/li&gt;
&lt;li&gt;Run the following commands
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;build-essential
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The &lt;code&gt;sudo&lt;/code&gt; command is used to run the subsequent commands with administrative privileges, which may require you to enter your password.&lt;/p&gt;
&lt;h3&gt;
  
  
  Windows
&lt;/h3&gt;

&lt;p&gt;To install C on Windows, we'll use the MinGW-w64 development environment, which provides a Windows port of GCC.&lt;br&gt;
Follow these steps:&lt;/p&gt;

&lt;p&gt;On Windows, you can use Chocolatey to install the MinGW-w64 development environment, which provides a Windows port of GCC. Here's how you can do it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the command prompt or PowerShell with administrative privileges.&lt;/li&gt;
&lt;li&gt;Install Chocolatey by &lt;a href="https://chocolatey.org/install" rel="noopener noreferrer"&gt;following the instructions on the official Chocolatey website&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Once Chocolatey is installed, run the following command to install MinGW-w64:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;mingw&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;During the installation, make sure to select the appropriate options as prompted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, if asked to run the script, type &lt;code&gt;a&lt;/code&gt; or &lt;code&gt;all&lt;/code&gt;. It means you want to run all scripts.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="kr"&gt;Do&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;you&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;want&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;run&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="nf"&gt;?&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;Y&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="n"&gt;es/&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;A&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="n"&gt;ll&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;yes&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;all/&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="n"&gt;o/&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="n"&gt;rint&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;After the installation is complete, you should have the GCC compiler available on your system. You can verify the installation by running the command gcc --version in the command prompt or PowerShell.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  Alternative installation on Windows OS
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Visit the &lt;a href="https://www.mingw-w64.org/downloads/" rel="noopener noreferrer"&gt;MinGW-w64 website and download the installer&lt;/a&gt; for your system architecture (32-bit or 64-bit).&lt;/li&gt;
&lt;li&gt;Run the installer and ensure you select the &lt;strong&gt;Add to PATH&lt;/strong&gt; option during installation.&lt;/li&gt;
&lt;li&gt;After installation, open the command prompt or PowerShell.&lt;/li&gt;
&lt;li&gt;Run the following command to verify the installation:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;printf&lt;/code&gt; is used to output (print) the result in the terminal.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Writing and Compiling a C Program
&lt;/h2&gt;

&lt;p&gt;Now that you have C installed, let's write a simple &lt;strong&gt;&lt;code&gt;Hello, World!&lt;/code&gt;&lt;/strong&gt; program and compile it. Follow the steps below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a file named &lt;code&gt;hello.c&lt;/code&gt; and paste (right click) the following code into it and save (based on the editor):
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello, World!&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vim hello.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Save file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;:wq&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Enter&lt;/code&gt; or &lt;code&gt;Return&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano hello.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Save file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Ctrl + O Ctrl + C Ctrl + X&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Y&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Enter&lt;/code&gt; or &lt;code&gt;Return&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;emacs &lt;span class="nt"&gt;-Q&lt;/span&gt; &lt;span class="nt"&gt;-nw&lt;/span&gt; hello.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;It is the same as &lt;code&gt;emacs hello.c&lt;/code&gt; except that it might open the GNU graphical interface:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;emacs hello.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Save file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Ctrl + X Ctrl + S&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Ctrl + X Ctrl + C&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open the terminal or command prompt and navigate to the directory where the &lt;code&gt;hello.c&lt;/code&gt; file is located.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use the &lt;code&gt;gcc&lt;/code&gt; command to compile the program and generate an executable file:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc hello.c &lt;span class="nt"&gt;-o&lt;/span&gt; hello
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc hello.c &lt;span class="nt"&gt;-o&lt;/span&gt; hello.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The &lt;code&gt;-o&lt;/code&gt; option specifies the output file name (in this case, &lt;code&gt;hello&lt;/code&gt;).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run the program by executing the generated executable file:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./hello
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./hello.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You should see the output &lt;strong&gt;&lt;code&gt;Hello, World!&lt;/code&gt;&lt;/strong&gt; displayed in the terminal or command prompt.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz7jkz5iqhp6gj8q2wglq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz7jkz5iqhp6gj8q2wglq.png" alt="executing a c program" width="800" height="146"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Practice
&lt;/h2&gt;

&lt;p&gt;Assuming you &lt;a href="https://replit.com/signup" rel="noopener noreferrer"&gt;have an account&lt;/a&gt; or are already &lt;a href="https://replit.com/login" rel="noopener noreferrer"&gt;logged in&lt;/a&gt; on Replit.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://replit.com/@OsagieNoah/helloWorldC#hello.c" rel="noopener noreferrer"&gt;Try the Replit&lt;/a&gt; Editor online.&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Fork&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;Edit the current code.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@OsagieNoah/helloWorldC?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Congratulations! You've learned how to create directories, check if C is installed, install C if needed, and write a simple C program. This knowledge forms the foundation for your C programming journey. As you progress, you can explore more complex programs and dive deeper into the language's capabilities. Have fun coding and building amazing software with C! If you have any further questions, feel free to ask.&lt;/p&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.learn-c.org/" rel="noopener noreferrer"&gt;Learn C - Free Interactive C Tutorial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.tutorialspoint.com/cprogramming/" rel="noopener noreferrer"&gt;Learn C Programming - Tutorialspoint&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/c-programming-language/" rel="noopener noreferrer"&gt;C Programming - GeeksforGeeks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.codecademy.com/learn/learn-c" rel="noopener noreferrer"&gt;C Programming - Codecademy&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Happy Coding&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>c</category>
      <category>tutorial</category>
      <category>softwareengineering</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
