1

I have tried so hard but I can't get C++ to work in my HTML. I need it.

<script type="application/cpp">
  print('Hello world')
</script>

I know it will probably need a lib.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
CatWriter
  • 31
  • 1
  • 1
  • 4

1 Answers1

1
 <script type="application/cpp">
     print('Hello world')   
    </script>

Browsers support running HTML, CSS, and Javascript. You can't inject c++ code into a web page in this manner. You will have to find a solution by means of browser plugin or an interpreter or compiler written in Javascript.

An example interpreter written in Javascript is JSCPP you can use the "with a modern browser" option to run a c++ program on a webpage.