<?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: Systems, Simply.</title>
    <description>The latest articles on DEV Community by Systems, Simply. (@systems_simply).</description>
    <link>https://dev.to/systems_simply</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4240289%2F8860112b-df9c-4a96-a4a5-8784f1be66fe.png</url>
      <title>DEV Community: Systems, Simply.</title>
      <link>https://dev.to/systems_simply</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/systems_simply"/>
    <language>en</language>
    <item>
      <title>From C Source Code to a Running Program</title>
      <dc:creator>Systems, Simply.</dc:creator>
      <pubDate>Fri, 13 Nov 2026 03:28:40 +0000</pubDate>
      <link>https://dev.to/systems_simply/from-c-source-code-to-a-running-program-1i5l</link>
      <guid>https://dev.to/systems_simply/from-c-source-code-to-a-running-program-1i5l</guid>
      <description>&lt;p&gt;Saving a C file and running a C program are different actions. An editor may put them behind one convenient button, but the steps still matter when something goes wrong.&lt;/p&gt;

&lt;p&gt;This walkthrough follows one small program from source code to output. Along the way, we will deliberately break it in two different ways, then investigate how an old executable can survive a failed build.&lt;/p&gt;

&lt;p&gt;By the end, you should be able to build and run the program, recognize the files involved, and choose a sensible first check when the result is unexpected.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Series:&lt;/strong&gt; C, One Experiment at a Time — Part 1.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Environment:&lt;/strong&gt; Windows, MSVC, C17 mode, and an x64 Visual Studio developer command prompt. The commands below use Command Prompt syntax. This assumes the Visual Studio C/C++ build tools are already installed; it is not an installation guide. Other toolchains use different commands and sometimes different filenames.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Start with a program whose result you can check
&lt;/h2&gt;

&lt;p&gt;Create a working folder and save this as &lt;code&gt;hello.c&lt;/code&gt;. Make sure the filename really ends in &lt;code&gt;.c&lt;/code&gt;, rather than &lt;code&gt;.c.txt&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="cp"&gt;#include &amp;lt;stdio.h&amp;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="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="nb"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Hello from C.\n"&lt;/span&gt;&lt;span class="p"&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;p&gt;Only a few details are needed for this experiment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;stdio.h&amp;gt;&lt;/code&gt; provides the declaration of &lt;code&gt;printf&lt;/code&gt;, the standard output function we use here. Including a header does not paste the implementation of &lt;code&gt;printf&lt;/code&gt; into this file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;int main(void)&lt;/code&gt; defines the starting function for this ordinary hosted C program. &lt;code&gt;void&lt;/code&gt; here means that this function has no parameters.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;printf&lt;/code&gt; writes the message to standard output, which normally appears in our terminal. &lt;code&gt;\n&lt;/code&gt; adds a newline.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;return 0;&lt;/code&gt; reports successful completion to the environment that started the program. It does not print a zero.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is a visible, checkable result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello from C.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Build first, then run
&lt;/h2&gt;

&lt;p&gt;Open an &lt;strong&gt;x64 Native Tools Command Prompt for Visual Studio&lt;/strong&gt;, then change to the folder containing &lt;code&gt;hello.c&lt;/code&gt;. If its path contains spaces, put the path in double quotes.&lt;/p&gt;

&lt;p&gt;Build with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="n"&gt;cl&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nologo&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;c17&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="no"&gt;W4&lt;/span&gt; &lt;span class="n"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the command finishes successfully, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="n"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exe&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first command creates a program. The second starts it.&lt;/p&gt;

&lt;p&gt;Here, &lt;code&gt;cl&lt;/code&gt; is MSVC's compiler driver: it can control compilation and invoke the linker. &lt;code&gt;/std:c17&lt;/code&gt; selects C17 mode, &lt;code&gt;/W4&lt;/code&gt; enables a useful warning level, and &lt;code&gt;/nologo&lt;/code&gt; hides the startup banner. Warnings deserve attention even when a build succeeds.&lt;/p&gt;

&lt;p&gt;For this simple build, you should find &lt;code&gt;hello.obj&lt;/code&gt; and &lt;code&gt;hello.exe&lt;/code&gt; alongside your source file. A larger project or an IDE may place these outputs elsewhere.&lt;/p&gt;

&lt;p&gt;If the terminal says that &lt;code&gt;cl&lt;/code&gt; is not recognized, check that you opened the developer command prompt and installed the C/C++ tools. That message is about the tool environment, not a diagnosis of your C code.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Make the build stages visible
&lt;/h2&gt;

&lt;p&gt;Our useful first model is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hello.c  --compile to object--&amp;gt;  hello.obj
hello.obj  ------link---------&amp;gt;  hello.exe
hello.exe  ------run----------&amp;gt;  terminal output
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft4d8cpe8zdq6a8z2d7e4.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft4d8cpe8zdq6a8z2d7e4.png" alt="C source code is compiled into an object file, linked into an executable, and run to produce output. The simplified compile step groups preprocessing, compilation and assembly. Example filenames use MSVC on Windows." width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The middle file is worth noticing. An object file is an intermediate input to the linker; it is not the final executable you start in this walkthrough.&lt;/p&gt;

&lt;p&gt;We can ask MSVC to stop before linking:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="n"&gt;cl&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nologo&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;c17&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="no"&gt;W4&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="n"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;/c&lt;/code&gt; option produces the object file without invoking the linker. Then link explicitly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="n"&gt;link&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nologo&lt;/span&gt; &lt;span class="n"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="no"&gt;OUT&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exe&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="n"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exe&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output is still &lt;code&gt;Hello from C.&lt;/code&gt; We changed how explicitly we requested the stages, not what the program does.&lt;/p&gt;

&lt;p&gt;“Compile to object” is a simplified label. A conventional toolchain also preprocesses the source and translates it through compilation and assembly before linking. The diagram groups those earlier stages so we can focus on the distinction between building and running. It is not claiming that every implementation exposes identical files or separate commands for each stage.&lt;/p&gt;

&lt;p&gt;Linking brings together the required object code and libraries and resolves references between them. In this example, it connects our program with the runtime support it needs. A header declaration and a function implementation have different jobs; including &lt;code&gt;&amp;lt;stdio.h&amp;gt;&lt;/code&gt; does not remove the need for linking.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Break compilation: remove one semicolon
&lt;/h2&gt;

&lt;p&gt;Save this separate file as &lt;code&gt;syntax_error.c&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="cp"&gt;#include &amp;lt;stdio.h&amp;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="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="nb"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Hello from C.\n"&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;p&gt;Try compiling it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="n"&gt;cl&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nologo&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;c17&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="no"&gt;W4&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="n"&gt;syntax_error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The semicolon after &lt;code&gt;printf(...)&lt;/code&gt; is missing. In the tested MSVC environment, this reports &lt;strong&gt;C2143&lt;/strong&gt;, pointing near &lt;code&gt;return&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;An error location is where the compiler detected a problem; the edit you need may be just before it. Check the diagnostic and the surrounding code, rather than assuming the highlighted token is always the cause.&lt;/p&gt;

&lt;p&gt;This attempt has not reached a successful link or run. Fix the syntax before investigating the program's output.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Break linking: promise a function, but never define it
&lt;/h2&gt;

&lt;p&gt;Save this as &lt;code&gt;missing_definition.c&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="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;missing_function&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="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="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;missing_function&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first line declares a function. For now, think of it as describing how the function can be called, without providing its body.&lt;/p&gt;

&lt;p&gt;Compile it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="n"&gt;cl&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nologo&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;c17&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="no"&gt;W4&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="n"&gt;missing_definition&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This succeeds in the tested environment and creates &lt;code&gt;missing_definition.obj&lt;/code&gt;. Now try to link it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="n"&gt;link&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nologo&lt;/span&gt; &lt;span class="n"&gt;missing_definition&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="no"&gt;OUT&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;missing_definition&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exe&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;MSVC reports &lt;strong&gt;LNK2019&lt;/strong&gt;, followed by &lt;strong&gt;LNK1120&lt;/strong&gt;. Our object code refers to &lt;code&gt;missing_function&lt;/code&gt;, but we have supplied no definition in an object file or library.&lt;/p&gt;

&lt;p&gt;Why can compilation succeed? In a multi-file program, a function's definition can live elsewhere. The linker is where that missing piece must be resolved for this build.&lt;/p&gt;

&lt;p&gt;The useful distinction is already visible: code can compile into an object file and still fail to become a usable executable. We will return to function declarations and definitions in the functions unit.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Why can an old message appear after a failed build?
&lt;/h2&gt;

&lt;p&gt;Return to a working &lt;code&gt;hello.c&lt;/code&gt;. Change its message to &lt;code&gt;Version 1&lt;/code&gt;, build successfully, and run it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Version 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now change the message to &lt;code&gt;Version 2&lt;/code&gt;, but deliberately remove the semicolon:&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="nb"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Version 2\n"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file and run the build command again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="n"&gt;cl&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;nologo&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;c17&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="no"&gt;W4&lt;/span&gt; &lt;span class="n"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It fails. If you then explicitly run the existing executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="n"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exe&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;it can still print:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Version 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No time travel involved. In this tested sequence, compilation failed before replacing the previous executable, and we manually launched that older file.&lt;/p&gt;

&lt;p&gt;This does &lt;strong&gt;not&lt;/strong&gt; mean every IDE automatically runs an old build after an error. An IDE may stop, prompt you, or handle output differently. The experiment deliberately separates the failed build from the later command that starts the existing file.&lt;/p&gt;

&lt;p&gt;Restore the semicolon, save, build successfully, and run again. The output becomes &lt;code&gt;Version 2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;When an edit appears to do nothing, check:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Did you save the intended source file?&lt;/li&gt;
&lt;li&gt;Did the latest build actually succeed?&lt;/li&gt;
&lt;li&gt;Are you running the executable from that build, in the intended directory?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Saving a new source file does not by itself update an existing executable.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. A successful build still needs a result check
&lt;/h2&gt;

&lt;p&gt;There is another kind of mistake that these build stages cannot diagnose for you:&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 &amp;lt;stdio.h&amp;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="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="nb"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"2 + 3 = %d\n"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&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="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;p&gt;This builds and runs in the tested environment, producing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2 + 3 = -1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The label says addition, but the expression performs subtraction. Both are valid C; the compiler does not know which task we intended.&lt;/p&gt;

&lt;p&gt;“It builds” is good news. It is not a correctness certificate. Compare the output with an expected result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it yourself
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Change the greeting, predict the output, then save, rebuild, and run.&lt;/li&gt;
&lt;li&gt;Repeat the missing-semicolon experiment. Before running anything, identify whether the latest build succeeded.&lt;/li&gt;
&lt;li&gt;Fix the arithmetic example, then explain why its earlier version could build successfully.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We now have a practical foundation for the next unit: variables, types, and expressions. That is where we will start replacing fixed examples with values we can store and calculate with.&lt;/p&gt;

&lt;p&gt;If you have seen a program ignore your edits, what turned out to be the cause: an unsaved file, a failed build, a different executable, or something else?&lt;/p&gt;

&lt;h2&gt;
  
  
  References and testing
&lt;/h2&gt;

&lt;p&gt;The normal build, separate compilation and linking, intentional compile/link failures, arithmetic mistake, and old-executable sequence were executed locally with MSVC on Windows in C17 mode. Diagnostic numbers and wording may differ with another compiler. This walkthrough does not claim to test runtime crashes or other toolchains.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/cpp/build/reference/compiler-options?view=msvc-170" rel="noopener noreferrer"&gt;MSVC compiler driver and environment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/cpp/build/reference/c-compile-without-linking?view=msvc-170" rel="noopener noreferrer"&gt;MSVC: compile without linking&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version?view=msvc-170" rel="noopener noreferrer"&gt;MSVC: language standard modes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk2019?view=msvc-170" rel="noopener noreferrer"&gt;MSVC: LNK2019&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html" rel="noopener noreferrer"&gt;GCC: conventional build stages&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Writing note: Prepared with AI assistance; code examples were tested locally.&lt;/p&gt;

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