How does VisualStudio run multiple main functions

(1) Create the project first, and then create two files containing the main function, which can be cpp or cu to
insert image description here
run directly and report an error
insert image description here

Correction method:
insert image description here

choose yes
insert image description here

insert image description here
There is a sign in the lower left corner of the removed file, and it runs smoothly
insert image description here

Guess you like

Origin blog.csdn.net/qq_40514113/article/details/130884651