Permission denied running a c file

Asked by makande

Well..
I'm new to ubuntu, just using it for about a wek or so!!
and a compiled e c file (everything's fine) and when running it, this appears;

  "bash: ./Potencia.c: Permission denied"

I don't know what to do, hope you can help me!
Thanks in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gcc-defaults Edit question
Assignee:
No assignee Edit question
Solved by:
makande
Solved:
Last query:
Last reply:
Revision history for this message
Rodolphe Ortalo (rodolphe-ortalo) said :
#1

Assuming you compiled your C source file "Potencia.c" using the following command:
gcc Potentia.c
The resulting executable file should be in the same directory as the source file, named "a.out". So you should run it by typing "./a.out" (or simply "a.out" if the current directory "." is in your $PATH).
If you want to name the executable produced by the compiler differently, compile it using the "-o" gcc option, for example:
gcc -o Potentia Potentia.c

PS: "man gcc" is your friend...

Revision history for this message
makande (marco-alves-novo) said :
#2

Thanks, I was doing something wrongm it's all good now!!!