IDE does not compile and run whatever source file you open. It depends on what project you open, so check if your a.cpp is added to the project By the way, use VS2013 It's very simple. If you need help, I can further teach you how to use VS2013/2015
Easy way to use VS2013. Whenever you need to write a program, click File->New->Project->Visual C++->Win32->Win32 Console Application and select (Project)Name, Solution Name and Location (the default value is to create a new folder with the same name as Solution Name in Location). After filling in, you can start writing.
If you select Empty Project in the wizard, then you need to right-click on the Source directory in Solution Explorer to create a new cpp.
The rest is simple. After writing F5, if you want to take a look at the final result after outputting it, you can add a read function such as getc/cin. If you use Ctrl+F5, although you can take a look, you cannot debug it.
Because VS2013 can only open one Solution at a time, you can’t make a mistake. And if you want to open a program that you have written before, don't open the cpp file directly. You should open the solution.
It seems that the author should be from a scripting language background. The executable file generated by C/Cpp is based on the entrance. It is not generated from one source file. One source file generates one o, but the final execution sequence is For classes, you still need to look at the entry function
Do both cpps have main functions? If A.cpp does not exist and B.cpp does, then B must be executed, and the main function is the entry point of the program; If both files have main functions, in theory they should not compile if they are in the same project. That’s right, because a project can only have one entrance;
You have to see if your project is B
IDE does not compile and run whatever source file you open. It depends on what project you open, so check if your a.cpp is added to the project
By the way, use VS2013 It's very simple. If you need help, I can further teach you how to use VS2013/2015
It is recommended to learn early vs
After all, devcpp is an entertainment ide
Easy way to use VS2013. Whenever you need to write a program, click
File->New->Project->Visual C++->Win32->Win32 Console Application
and select (Project)Name, Solution Name and Location (the default value is to create a new folder with the same name as Solution Name in Location). After filling in, you can start writing.
If you select Empty Project in the wizard, then you need to right-click on the Source directory in Solution Explorer to create a new cpp.
The rest is simple. After writing F5, if you want to take a look at the final result after outputting it, you can add a read function such as getc/cin. If you use Ctrl+F5, although you can take a look, you cannot debug it.
Because VS2013 can only open one Solution at a time, you can’t make a mistake. And if you want to open a program that you have written before, don't open the cpp file directly. You should open the solution.
It seems that the author should be from a scripting language background. The executable file generated by C/Cpp is based on the entrance. It is not generated from one source file. One source file generates one o, but the final execution sequence is For classes, you still need to look at the entry function
Could it be that before pressing Run A, you did not select the window of A and press F9 (compile).
Do both cpps have main functions?
If A.cpp does not exist and B.cpp does, then B must be executed, and the main function is the entry point of the program;
If both files have main functions, in theory they should not compile if they are in the same project. That’s right, because a project can only have one entrance;
Dev cpp is run according to the project, not according to the file you open!
A project has only one main.