Ubuntu – How to compile and run C programs avoiding “bash: ./a.out: Permission denied”

10.10cgcc

I have installed GCC compiler by installing the build-essential package.

After the installation I wrote a simple C program. I tried to run it with the following command:

gcc First.c
./a.out

but I'm getting a bash: ./a.out: Permission denied message. I don't know what to do now.

Best Answer

give that program (I mean a.out) the permission to "be executed" by this command:

chmod +x ./a.out

then execute it ;-)

Related Question