title: How to call a C++ method from C?
body: <p>I have a C++ class and I'm compiling it with some C files.</p>
  
  <p>I want to call a function which is defined in C++, actually in C++ class, so what am I going to do?</p>
  
  <p>The following declarations to show what am I saying: there may there be syntax errors:</p>
  
  <p>serial_comm.cpp</p>
  
  <pre><code>class MyClass {
      void sendCommandToSerialDevice(int Command, int Parameters, int DeviceId) {
           //some codes that write to serial port.
      }
  }
  </code></pre>
  
  <p>external.c</p>
  
  <pre><code>int main(int argc, char ** argv) {
      //what am I going to write here?
  }
  </code></pre>