I just start playing around with C++ and how to combine it with Emacs. This website on cpp-programming and Intro to C++ are the starting point for me. The extended aim is to be able to write some C++ codes that can be part of R.
Standard Hello World!.
#include <iostream>
using namespace std;
int main(){
cout << "Hello World!" << endl;
return 0;
}
To compile this basic code in Emacs then use make with the following:
M-x compileorSPC c cin Doom.- type
make basic. This will useMakefileto findbasic.cppfile to compile and useg++. - An executable file named
basicwill be produced. - Run the file eg.
./basic - If you alter the file then you can
M-x recompileorSPC c C
A nice description on using Makefile can also be found here doc.ic.ac.uk