<?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: Mayank</title>
    <description>The latest articles on DEV Community by Mayank (@low-level-systems).</description>
    <link>https://dev.to/low-level-systems</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%2F3976344%2Fd5a61f88-dee6-438f-b8af-98c2410b4fa7.png</url>
      <title>DEV Community: Mayank</title>
      <link>https://dev.to/low-level-systems</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/low-level-systems"/>
    <language>en</language>
    <item>
      <title>Day 02 — How C Source Code Becomes an Executable</title>
      <dc:creator>Mayank</dc:creator>
      <pubDate>Tue, 09 Jun 2026 17:30:21 +0000</pubDate>
      <link>https://dev.to/low-level-systems/day-02-how-c-source-code-becomes-an-executable-39l4</link>
      <guid>https://dev.to/low-level-systems/day-02-how-c-source-code-becomes-an-executable-39l4</guid>
      <description>&lt;h2&gt;
  
  
  What I Learned Today
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Why we need a Compiler.&lt;/li&gt;
&lt;li&gt;How C source code is compiled to executable [CPU readable instructions].&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="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="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;h2&gt;
  
  
  Why we need a Compiler
&lt;/h2&gt;

&lt;p&gt;Suppose we need to print Hello in our terminal but our CPU only understand 0's and 1's. Though we can write it in 0's and 1's for Hello but what if we need to calculate some big number we can't always write in 0's and 1's it's tedious task. Though you can write it if you have few screws loose.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;But&lt;/em&gt; we can write in human readable format and then use another program to convert it into Machine codes. Yes, That where our Compiler comes in.&lt;/p&gt;

&lt;p&gt;Writing C code in a file don't make it a C code it will remain a text file if we don't follow the syntax rules of C, save that file with .c extension and use a C compiler to convert it into an executable file that can be read by CPU.&lt;/p&gt;

&lt;h2&gt;
  
  
  Source code -&amp;gt; executable
&lt;/h2&gt;

&lt;p&gt;In this piece of code it prints : Hello, World!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;#include : Is the Directive, It provide Declarations for the functions we are using.&lt;/li&gt;
&lt;li&gt;int main() : function named main -&amp;gt; The entry point of the program from where the OS will load the program step by step.&lt;/li&gt;
&lt;li&gt;printf("Hello, World!") : printf functions that we are using from stdio[Standard Input/Output Library] to print our string on terminal.&lt;/li&gt;
&lt;li&gt;return 0 : OS returns this integer when program is successfully executed.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Now we will look into how a source code is converted to executable code.&lt;/p&gt;

&lt;p&gt;When we run compile our code by using this command : gcc -Wall -o hello hello.c&lt;/p&gt;

&lt;p&gt;Here,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;gcc : Compiler we are using -&amp;gt; gcc [GNU C Compiler&lt;/li&gt;
&lt;li&gt;Wall : "Warn all" It's a compilation flag that gives us a broad sets of warning for code constructs.&lt;/li&gt;
&lt;li&gt;o : To specify the name of the output file. Without this if we compile our program it will always give a default executable called a.out&lt;/li&gt;
&lt;li&gt;hello : Name of our executable&lt;/li&gt;
&lt;li&gt;hello.c : Name of our program with .c extension&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It takes 3 steps to compile and then give us our executable code.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pre-Processing : The Pre-Processing only looks for line starting with '#', line starting with # is called directive. Directive hold the header files for the functions we are using in our code it's 'stdio.h'. Which holds the Declarations for that functions. When Pre-Processor start it will look for '#' after finding it, the Pre-Processor replace that directive with the actual code of the header file.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- It will give us expanded C code.
- To test it out write : gcc -E hello.c
- The output of the Pre-Processing step is expanded C code(stdio.h header file + our program code)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Compiler : In this step the compiler takes the expanded C code and convert it into CPU instructions[Binary code/Machine code].&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Linker : Take the Machine code and the C library(In this case our standard Library) which have the compiled code needed by our functions to work in our case printf compiled code is present in the C standard Library. Linker stitches everything and finally provide an executable file.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>c</category>
      <category>beginners</category>
      <category>basics</category>
    </item>
    <item>
      <title>printf("Hello\n");</title>
      <dc:creator>Mayank</dc:creator>
      <pubDate>Tue, 09 Jun 2026 17:04:53 +0000</pubDate>
      <link>https://dev.to/low-level-systems/printfhellon-nc7</link>
      <guid>https://dev.to/low-level-systems/printfhellon-nc7</guid>
      <description>&lt;p&gt;Hello everyone,&lt;/p&gt;

&lt;p&gt;I'm Mayank, and I'm starting my journey into low-level programming by learning and building in C. I know it's a long and hard road, but I'm committed to exploring this space and understanding how things work at the ground level.&lt;/p&gt;

&lt;p&gt;I'll be posting here every weekday — sharing what I learned that day, the code I wrote, and the concepts I ran into. Everything is also on my GitHub repo if you want to follow along or look at the code directly.&lt;/p&gt;

&lt;p&gt;I'm learning in public on purpose. If I get something wrong, I want to know. If you see a mistake in my understanding or my code, please point it out — that's exactly why I'm posting here.&lt;br&gt;
Let's see how far this goes.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>c</category>
    </item>
  </channel>
</rss>
