How to run C++ code in Google Colab painlessly
12.8 هزار بار بازدید -
4 سال پیش
-
see also:how to include header
see also:
how to include header and source files
Run C++ project in Google Colab combi...
https://sites.google.com/view/vinegar...
Create a notebook on Google Colab, and the create the necessary header source and main files. It is possible to execute C++ code right inside Google Colab. You can then expand Colab beyond just running Python scripts.
(C++ header file)
%%writefile test.h
(C++ source code):
%%writefile test.cpp
(C++ main)
%%writefile main.cpp
//Main function
int main(int Argc,char* Args[]){
return 0;
}
(Compile and run):
%%script bash
%%script bash
g++ main.cpp -std=c++11
./a.out
how to include header and source files
Run C++ project in Google Colab combi...
https://sites.google.com/view/vinegar...
Create a notebook on Google Colab, and the create the necessary header source and main files. It is possible to execute C++ code right inside Google Colab. You can then expand Colab beyond just running Python scripts.
(C++ header file)
%%writefile test.h
(C++ source code):
%%writefile test.cpp
(C++ main)
%%writefile main.cpp
//Main function
int main(int Argc,char* Args[]){
return 0;
}
(Compile and run):
%%script bash
%%script bash
g++ main.cpp -std=c++11
./a.out
4 سال پیش
در تاریخ 1399/10/30 منتشر شده
است.
12,825
بـار بازدید شده