<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>C/C++ on LeafCxy's Blog</title><link>https://leafcxy.github.io/tags/c/c++/</link><description>Recent content in C/C++ on LeafCxy's Blog</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Wed, 23 Sep 2026 09:18:00 +0800</lastBuildDate><atom:link href="https://leafcxy.github.io/tags/c/c++/index.xml" rel="self" type="application/rss+xml"/><item><title>编译原理入门：词法分析器与 Flex/Bison 黄金搭档实战</title><link>https://leafcxy.github.io/posts/2026/09/compiler-lexical-analysis-flex-bison-tutorial/</link><pubDate>Wed, 23 Sep 2026 09:18:00 +0800</pubDate><guid>https://leafcxy.github.io/posts/2026/09/compiler-lexical-analysis-flex-bison-tutorial/</guid><description>&lt;p&gt;在每一个程序员的学习生涯中，“编译器究竟是如何把一堆英文字符代码变成可执行程序的”往往是最令人着迷的谜题之一。&lt;/p&gt;
&lt;p&gt;当你键入如下命令准备折腾编译器前端时：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get install flex
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get install bison
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;你实际上已经推开了计算机科学中最经典、最精巧的技术大门：&lt;strong&gt;词法分析器（Lexer）&lt;/strong&gt; 与 &lt;strong&gt;语法分析器（Parser）&lt;/strong&gt;。&lt;/p&gt;</description></item><item><title>深入理解程序内存布局：代码区、全局区、堆区与栈区</title><link>https://leafcxy.github.io/posts/2026/09/memory-layout-code-data-heap-stack/</link><pubDate>Wed, 23 Sep 2026 09:11:00 +0800</pubDate><guid>https://leafcxy.github.io/posts/2026/09/memory-layout-code-data-heap-stack/</guid><description>&lt;p&gt;在编写程序时，无论是使用 C/C++ 这种面向系统底层的语言，还是 Java、Go、Rust、Python 等拥有运行时环境的高级语言，程序最终都需要被加载到操作系统的虚拟内存中执行。&lt;/p&gt;
&lt;p&gt;很多开发者在日常编码中常听到“变量在栈上”、“对象在堆中”、“全局变量存哪里”、“为什么递归太深会导致栈溢出”、“为什么堆内存容易产生碎片”等问题。要彻底理清这些概念，关键在于理解进程的&lt;strong&gt;虚拟内存空间布局（Virtual Memory Layout）&lt;/strong&gt;。&lt;/p&gt;</description></item></channel></rss>