Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running c++ in browser

Tags:

c++

html

I have written some basic c++ programs in one of my classes for school. I was wondering if it was possible to somehow virtually run the program in a broswer. I would like to post the program to my website. Once its posted, a person could access the program, run the program, and, interact with the program. I'm not trying to write C++ for my website, it would be more for an interactive portfolio.

Is this possible?

like image 740
Nick Avatar asked Nov 04 '11 00:11

Nick


People also ask

Can you run C in a browser?

Running a C program in a browser using the standard library doesn't make any sense. Even if you had the whole C library available, you wouldn't be able to use it. The browser doesn't allow interacting with the system directly from its JavaScript runtime, it's a security measure.

Can we run C++ in browser?

Use codepad, a website which lets you compile and share code online. Show activity on this post. There is also Google Native Client SDK that allows C++ code to run in browser. Microsoft Active X is also a viable option.

Is there any online compiler for C?

Online C Compiler (GNU GCC v7.1.1) helps you to Edit, Run and Share your C Code directly from your browser. This development environment provides you version GNU GCC v7.1.1.


2 Answers

Use codepad, a website which lets you compile and share code online.

#include <iostream>

int main(int argc, char** argv) {
  std::cout << "Hello, Stack Overflow!" << std::endl;
  return 0;
}
like image 74
vz0 Avatar answered Oct 19 '22 15:10

vz0


There is also Google Native Client SDK that allows C++ code to run in browser. Microsoft Active X is also a viable option. I am only saying it is possible not recommended.

like image 5
parapura rajkumar Avatar answered Oct 19 '22 13:10

parapura rajkumar