title: How to pass a string to C code compiled with emscripten for WebAssembly
body: <p>I've been looking a the WebAssembly website and tutorials and I feel a bit lost. </p>
  
  <p>I have the following C code : </p>
  
  <pre><code>void EMSCRIPTEN_KEEPALIVE hello(char * value){
      printf("%s\n", value);
  }
  </code></pre>
  
  <p>I compiled it with (I'm also not sure this part is the best way to go) : </p>
  
  <pre><code>emcc demo.c -s WASM=1 -s NO_EXIT_RUNTIME=1 -o demo.js
  </code></pre>
  
  <p>From what I understand I can now use the demo.js glue code in my javascript class and call the method that way : </p>
  
  <pre><code>...
  &lt;script src="demo.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      function hello(){        
          // Get the value 
          var value = document.getElementById("sample");
          _hello(value.innerHTML);
      }
  &lt;/script&gt;
  ...
  </code></pre>
  
  <p>What I see being printed in the console when I call the method is : </p>
  
  <pre><code>(null)
  </code></pre>
  
  <p>Is there something I'm missing to pass a string value to C code compiled with WebAssembly ? </p>
  
  <p>Thanks a lot</p>