Use the C++ compiler, not the C compiler.
exec 'g++ j.cpp'
exec
will replace the current process, so you may want to use backticks instead.
output = `g++ j.cpp -o "prog" && ./prog`
The output file is specifically named as "prog" just to be more clear on what we are executing.
Anurag
2010-07-31 06:44:58