title: How to pass char* argument to a C method executed in Node.js?
body: <p>I have C code as follows:</p>
  
  <pre><code>int stringlen(char* p){
      return strlen(p);
  }
  </code></pre>
  
  <p>Which I compile using Emscripten compiler: <code>emcc -s EXPORTED_FUNCTIONS="['_stringlen']" example.c -o example.js</code></p>
  
  <p>Then, in Node.js, I call the compiled function <code>em_module1._stringlen('sadfsa')</code>. Unfortunately, the function returns <code>4</code> instead of <code>6</code> (the correct length of the string <code>'sadfsa'</code>).</p>
  
  <p>How can I pass correctly the <code>char*</code> from the Node.js to this compiled function?</p>