Can I delete the main.cpp file?
You can delete the main.cpp file but, as ChrisW67 said, you can't delete the main() function. That's the entry point to your program. You can move that function to another file (like Trial.cpp), but it has to be somewhere and it has to have the name main() with the correct arguments and return value.