<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://slightknowledge.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://slightknowledge.com/feed.php">
        <title>SlightKnowledge - lang:c</title>
        <description></description>
        <link>https://slightknowledge.com/</link>
        <image rdf:resource="https://slightknowledge.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-05-05T12:49:36+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://slightknowledge.com/doku.php?id=lang:c:binarycast&amp;rev=1757651731&amp;do=diff"/>
                <rdf:li rdf:resource="https://slightknowledge.com/doku.php?id=lang:c:classelement&amp;rev=1755423263&amp;do=diff"/>
                <rdf:li rdf:resource="https://slightknowledge.com/doku.php?id=lang:c:pybind11&amp;rev=1757162718&amp;do=diff"/>
                <rdf:li rdf:resource="https://slightknowledge.com/doku.php?id=lang:c:windows&amp;rev=1757164802&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://slightknowledge.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>SlightKnowledge</title>
        <link>https://slightknowledge.com/</link>
        <url>https://slightknowledge.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="https://slightknowledge.com/doku.php?id=lang:c:binarycast&amp;rev=1757651731&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-12T04:35:31+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>binarycast</title>
        <link>https://slightknowledge.com/doku.php?id=lang:c:binarycast&amp;rev=1757651731&amp;do=diff</link>
        <description>バイナリデータで、double 型に変換する方法。
little endian で確認
uint64_t x;
double v = *(double *) &amp;x;</description>
    </item>
    <item rdf:about="https://slightknowledge.com/doku.php?id=lang:c:classelement&amp;rev=1755423263&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-08-17T09:34:23+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>classelement</title>
        <link>https://slightknowledge.com/doku.php?id=lang:c:classelement&amp;rev=1755423263&amp;do=diff</link>
        <description>Operator

c++ で class を配列のように取り扱う

実装

operator を使う。



class Test {
public:
  uint64_t operator[](const uint64_t index) const {
    return data[index];
  }

  uint64_t&amp; operator[](const uint64_t index){ 
    return data[index];
  }
  
private:
  uint64_t data[1024];
  
};</description>
    </item>
    <item rdf:about="https://slightknowledge.com/doku.php?id=lang:c:pybind11&amp;rev=1757162718&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-06T12:45:18+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>pybind11</title>
        <link>https://slightknowledge.com/doku.php?id=lang:c:pybind11&amp;rev=1757162718&amp;do=diff</link>
        <description>pybind11

C/C++ のコードを python で利用する。

個人的には、boost よりも使いやすい。

基本


#include &lt;iostream&gt;
#include &lt;cstdio&gt;
#include &lt;cstdlib&gt;

#include &lt;pybind11/pybind11.h&gt;

void functionInPython(void){
  std::cout &lt;&lt; &quot;call functionInCPP\n&quot;;
}

class ClassInCpp {

public:

  ClassInCpp(void) : varInClassInCpp(&quot;varInClassInCpp&quot;){ }

  std::string varInClassInCpp ;

  void functionClassInCpp(void){
    std::cout &lt;&lt; &quot;call functionClassInCpp\n&quot;;
  }

  template &lt;typename TT1&gt;
  TT1 templateFunctionInCpp(TT1 x){
    st…</description>
    </item>
    <item rdf:about="https://slightknowledge.com/doku.php?id=lang:c:windows&amp;rev=1757164802&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-06T13:20:02+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>windows</title>
        <link>https://slightknowledge.com/doku.php?id=lang:c:windows&amp;rev=1757164802&amp;do=diff</link>
        <description>Windows での C/C++ 環境構築

windows では、フリーソフトでもいくつかの環境が考えられる。

Linux のターミナル環境に慣れている場合、以下が使いやすい。

	*  MSYS2 をインストール
	*  MSYS2 で pacman で</description>
    </item>
</rdf:RDF>
