Skip to content
Sign upLog in
← Back to Community

How to run multiple C files.

Profile icon
DeepakR_28

image

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 [earned 5 cycles]
View Answer
Voters
Profile icon
nvadivel
Profile icon
frisonfrancesco
Profile icon
DameraAjitha
Profile icon
MAGANTI-SRI-ABH
Profile icon
NakkaKiranKumar
Profile icon
DeepakR_28
Comments
hotnewtop
Profile icon
Wumi4

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:

./filename
Profile icon
DeepakR_28

@Wumi4
Thank you soooo much!!!

Profile icon
DeepakR_28

@Wumi4

image

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??

Profile icon
Wumi4

@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.

Profile icon
programmeruser

@DeepakR_28 chmod +x <the name of the executable