ISSUE : AFTER HAVING MADE A NEW FOLDER AS REPOSITORY IN MY REPLS FOR LET’S SAY MY C CODES.
UNDER THIS FOLDER I AM MAKING MULTIPLE FILES IN THE FORMAT MAIN.C AS THE FIRST AUTOMATICALLY GENERATED FILE NAME. AFTER THAT IF I AM MAKING A NEW FILE BY THE NAME FOR THE CODE I.E DEQEUE.C OR STACK.C OR FILENAME.C NONE OF IT IS RUN BY CONSOLE. IT THROWS ERROR BECAUSE OF MAIN.C CODE IN REPLIT.FILE SOUCE CODE. I TRIED MODIFYING IT EVERYTIME TO RUN MY NEW CODE. CAN ANYONE HELP TO GENERATE A GENERALIZE AND A MORE FORMAL SOLUTION FOR THE SAME.
ADDITIONALLY AS OBERVED FROM THE SCREENSHOT I AM TRYING TO RUN STACK.C CODE BUT ITS STILL EXECUTING THE MAIN.C CODE THEREFORE NO ERRORS GENERATED.
**NEW TO THE CODING WORLD. HELP AND GUIDANCE APPRECIATED.
To change the default file that is run (in this case MAIN.C to STACK.C), you need to click on the three dots, click on show hidden files, find the .replit file, then change the filename near the first couple lines to STACK.C (originally main.c, then rerun your repl.
BTW: Consider avoiding using ALL CAPS as using it can make you appear like you’re screaming
OMG I WISH I HAD CANNED REPLIES (WHAT NATEDHALIWAL pOSTED)
This is correct, if you’re on the default c template, it attempts to compile all files ending in “.c”.
I’m not sure how compilers work, but if you have main functions defined in both files, only one of them will be executed. (this typically depends on what file the compiler sees first, but I might be wrong)