Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How to embed a CPP (C++) file into HTML (website)?

Long story short, my brother is going to college for game design and I'm going for web development, and before we even start we're practicing, and I was wondering how to embed a CPP file into a website so that way I can make a website for his text based game.

Update:

@Rainmaker, I understand that, but is there a way that I could possibly convert it to a different type of file to be run from a webpage? I found this: http://www.ucancode.net/Visual_C_MFC_Example/Conve... and it says it should be able to convert files from CPP to HTML to be run from a webpage.

5 Answers

Relevance
  • Anonymous
    9 years ago
    Favorite Answer

    Unless all you want to do is show the C++ source code, you can't.

    Exception: if you want to make an Internet Explorer-specific application. In that case, look into ActiveX plugins. (Not recommended. ActiveX is a sucky technology.)

    ########################################

    ################# EDIT #################

    ########################################

    My answer, above, was the first, and the only complete and correct one: the way you can run a C++ program in a web browser is by turning it into an ActiveX plugin, after which it'll only run in Internet Explorer / under Windows.

    The site you're referring to has a tool that converts your source code into HTML, in the sense that it SHOWS your C++ source code with colour coding --that is, it'll show the C++ keyword in one colour, your variables in another, etc. Which is exactly what I ALSO wrote in my initial response --the first line.

    Stop looking. It's not possible.

  • 9 years ago

    C++ is a compiled language, you can't run the code from a webpage.

  • Anonymous
    9 years ago

    Dear you don't have to worry. Just convert that in Csharp or ASPX as C++ is only a coding language.

    Hope it helped you out.

    I am a professional developer that's y assist you as per my capacity.

    Source(s): http://www.3wogle.com/ For Professional Web development
  • Anonymous
    5 years ago

    Place the following into the <HEAD> of your HTML file. <link href="webstyle.css" rel="stylesheet" type="text/css" />

  • How do you think about the answers? You can sign in to vote the answer.
  • 9 years ago

    just call you file link 1st in header and then you function in div.

Still have questions? Get your answers by asking now.