Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Hello Friends, can anybody explain me what is the error in this procedure of compiling and executing a c++ program file. enter image description here compiling and executing

share|improve this question
add comment

1 Answer

If you haven't specified the name of the executable to produce with -o NAME, it will be called a.out, rather than the same name as the source file.

So either do:

g++ program.cpp -o program
./program

or

g++ program.cpp
./a.out
share|improve this answer
    
command for executing the a.out file? –  grv.giit Jan 4 '13 at 15:01
    
thanks this solved my issue!! –  grv.giit Jan 4 '13 at 15:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.