This is my first time using Ubuntu to run a C-File with a codeBlocks
I tried save as a File "file1" without extension file.
Permission Denied
I tried chmod u+x file1
Wrong something but builded success
I tried give "file1.c"
File not found
This is my first time using Ubuntu to run a C-File with a codeBlocks
I tried save as a File "file1" without extension file.
Permission Denied
I tried chmod u+x file1
Wrong something but builded success
I tried give "file1.c"
File not found
First of all, Any C program is saved with .c Extension. And C++ program is saved with .cpp extension.
Now coming to compilation,
If you want to compile it using Terminal, Open the terminal (Press CTRL + ALT + T).
Go to the directory where the file is saved. (You can use cd command to change directory).
After reaching the directory , type gcc file1.c.
If there are no errors, then you can run the output by typing ./a.out.
Make sure you're the owner of the files. If you're not, you can run:
sudo chown usrname:username /path/to/your/file
Also make sure it's executable:
chmod +x /path/to/your/file