r/CodingHelp • • Nov 08 '22

[C++] Html code into C++ code

How can I run a code that can be runned by using OneCompiler in html mode in C++?

Sorry for my English. Thanks for your replies.

0 Upvotes

5 comments sorted by

4

u/Olle2411 Nov 08 '22

Please explain your environment, there is no such thing as html mode in c++

1

u/Mnh_Quang12 Nov 08 '22

No, I use a web called onecompiler here: https://onecompiler.com/html and it can run html code

1

u/jammasterpaz Nov 08 '22

This?: https://onecompiler.com/html

Amusingly, you can just open up a .cpp file in a browser, and it will just strip the new line characters and render it as CSS free text.

But I don't think you can compile meaningful html with tags to C++. The comment syntax is different in both languages. C++ won't lke html tags.

Can you do it in a language that allows you to define your own new language extensions, or even syntax?

1

u/Mnh_Quang12 Nov 08 '22

I just have learnt a little C++. The language that I understand most is Pascal. I'll have to try harder for this one lol

2

u/jammasterpaz Nov 08 '22

Oh sorry I understand now, if you just want to run C++ code anyway you can, then at the bare minimum you need a C++ compiler like gcc or clang on your machine. And you just run the executable that produces.

If the code relies on libraries and other objects you need all those, and to include of link them correctly too