K
K
Kirill Nikiforov2018-10-04 12:25:31
C++ / C#
Kirill Nikiforov, 2018-10-04 12:25:31

Compiling C++ from C++?

How to compile main2.cpp file in C++ and execute it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2018-10-04
@jcmvbkbc

How to compile main2.cpp file in C++ and execute it?

#include <stdlib.h>
int main()
{
    if (system("g++ main2.cpp -o main2") == 0)
        system("./main2");
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question