Ask coding questions

← Back to all posts
How to run multiple C files.
DeepakR_28 (1)

This is how I can store and run different python files in the same repl, how to do it for C language.

Answered by Wumi4 (531) [earned 5 cycles]
View Answer
Wumi4 (531)

You can open the Repl Terminal by using Ctrl+Shift+P or Ctrl+Shift+S. In the terminal, type:

# filename and filename.c are the file name that you want to compile
gcc -o filename filename.c

Then you should see an executable file called filename, run that file by using:

DeepakR_28 (1)

@Wumi4 Thank you soooo much!!!

DeepakR_28 (1)


it was working fine, but suddenly after fixing some errors i cant run any file.. why is is saying permission denied?? any help if possible??

Wumi4 (531)

@DeepakR_28 I think because your executable file does something that requires root permission (which is not possible in Repl) to do or Repl requires root permission to run every executable file. So maybe the possible way is to run it on your local computer or use .replit, of course with gcc installed. If you are in Windows, use MinGW for gcc binding.

programmeruser (597)

@DeepakR_28 chmod +x <the name of the executable