<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nandakagoodvibes</author_name>
  <author_url>https://blog.hatena.ne.jp/nandakagoodvibes/</author_url>
  <blog_title>なんだかGoodVibes</blog_title>
  <blog_url>https://nandakagoodvibes.hatenablog.com/</blog_url>
  <categories>
    <anon>C</anon>
  </categories>
  <description>こんにちは。 本日はC言語メモです。 概要 stdlib.hに含まれるatexit()を使用して 終了前に実行する関数を登録することができます。 atexit()で登録した関数は、 後入れ先出し方式で終了時に呼び出されます。 main関数でreturnして終了、exit()で終了、abort()で終了 それぞれのパターンで試したいと思います。 main関数でreturnして終了した場合 #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; void cleanup_func() { printf(&quot;[cleanup_func] 終了処理実行\n&quot;); } void fi…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnandakagoodvibes.hatenablog.com%2Fentry%2F2025%2F11%2F16%2F171630&quot; title=&quot;【C】atexit関数を使用して終了前処理を行う - なんだかGoodVibes&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-11-16 17:16:30</published>
  <title>【C】atexit関数を使用して終了前処理を行う</title>
  <type>rich</type>
  <url>https://nandakagoodvibes.hatenablog.com/entry/2025/11/16/171630</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
