Running c++ application in webbrowser?

Mar 27, 2012 at 7:54pm
is it possible? I would like to create some simple web-browser game but I don't feel like I can start to learn another programming language cuz I'm still improving my skills in c++, I know that you can run java in webbrowser, so what about c++?
Mar 27, 2012 at 7:57pm
Java runs through a virtual machine, and that's the reason why it could be run in any environment, and that's why it's cross platform (and slower than C++, however), but C++ talks to the processor and to the operating system. Unfortunately it's not possible to run C++ code in browsers, and that's why your browser complains with 10000 security messages when a website tries to run an installer on your computer.
Mar 27, 2012 at 8:01pm
well, can you then recommend me some language that is similliar to c++ and can be run in webbrowsers - also it is possible to create webbrowser games with it?
Mar 27, 2012 at 8:16pm
Java or Flash depending on how complex you want to get.
Mar 27, 2012 at 8:24pm
well not something really hardcore, just those clicking games like gladiatus, the crims etc
Mar 27, 2012 at 8:41pm
Java is very close to C++, in fact it's way easier than C++. In Java there are no pointers. You can call Java: (C++) - C = Java ;-)

It's very simple, everything is objects. You just have to familiarise yourself with the new language. It's not a big deal.
Mar 27, 2012 at 8:48pm
yeah but, isn't game in java like normal PC Game? I wanted to create only simple game like travian, tribalwars etc, I don't think they are created in java, or?
Mar 27, 2012 at 9:08pm
You can create a CGI script that will run in a web browser. You would have to set up the web browser to handle CGI scripts though. It is possible thought, I wrote a counter program that was a CGI script. Writing a whole game will be a huge challenge, but it can be done through CGI scripts because the CGI scripts is nothing more then an executable file with a CGI extension.

There is a common rule I live by, you can do anything with C / C++, it is just a matter of figuring out how.
Topic archived. No new replies allowed.