samedi 29 juillet 2017

Is it possible to combine c++ with any language?

I heard from a book (Professional C++) that c++ can be combined with like many languages, close to all by using "extern"

for example

extern "Lua" {
     //Some code in Lua
};

extern "Python" {
     //Some code in Python
};

extern "C" {
     //Some code in C
};

int main(int argc, char* argv[]){
     //Some C++ code
     return 0;
}

Now I know that you can combine C and ASM with c++, but like I said before can we use a lot more other languages like Lua Python PHP etc.

Or does it only work with languages that are dependent on C/C++?

Aucun commentaire:

Enregistrer un commentaire