When i run the file it gives the output of the first file and i am not able to run the second file I am using C++ pls help

Question: When i run the file it gives the output of the first file and i am not able to run the second file I am using C++ pls help

Repl link: https://replit.com/@NewtGaming1/1

code snippet

You can change which file is run using the .replit file.
First, show hidden files,
image
Then, open .replit and edit these lines to the file of your choosing:
image

Replit runs only one file. You can change this in the config file.

Just click the next to “Files” then click “Show hidden files”. Next click on the .replit file and finally you can change the entrypoint to whatever file you want to run.

Images

Dots

Show hidden files

edited

You should also see the docs on how to configure a Repl: https://docs.replit.com/programming-ide/configuring-repl

And if you want to run the last edited file, take a look at this post:

bro its the same
still i am getting this error

@NewtGaming1 if you want to have separate programs in separate files use separate Repls.

@CoderElijah doesn’t work for C++, it only changes the file that opens when you open the Repl.

The target file does not exist. Either create main.cpp, rename an existing file, or change the entrypoint.

No. That doesn’t change the file to run.

1 Like

Creating main.cpp would be the easiest solution or changing run would work.