title: C/C++ API for dmidecode
body: <p><code>dmidecode</code> lists various hardware parameters, including size, model, and serial numbers of the actual DRAM modules installed.  </p>
  
  <p>Without using <code>system()</code> and parsing the output text, is there a programmatic interface to obtain the same information via C/C++?</p>
  
  <p>For example:</p>
  
  <pre><code>dmidecode --type 17
  # dmidecode 2.12
  SMBIOS 2.7 present.
  
  Handle 0x0043, DMI type 17, 34 bytes
  Memory Device
      Array Handle: 0x0042
      Error Information Handle: Not Provided
      Total Width: 64 bits
      Data Width: 64 bits
      Size: 4096 MB
      Form Factor: DIMM
      Set: None
      Locator: ChannelA-DIMM0
      Bank Locator: BANK 0
      Type: DDR3
      Type Detail: Synchronous
      Speed: 1600 MHz
      Manufacturer: 0711
      Serial Number: 00000000
      Asset Tag: 9876543210
      Part Number: PUD31600C114G2VS
      Rank: 1
      Configured Clock Speed: 1600 MHz
  
  Handle 0x0044, DMI type 17, 34 bytes
  Memory Device
      Array Handle: 0x0042
      Error Information Handle: Not Provided
      Total Width: Unknown
      Data Width: Unknown
      Size: No Module Installed
  </code></pre>