Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

visual studio 2010 single project with multiple cpp files with main

I want to examine a lot of little cpp files that have int main() , and run only one of them at one running . something like this -

enter image description here

Is there any way to do that without open new project for every cpp file ?

like image 560
URL87 Avatar asked Apr 24 '26 08:04

URL87


2 Answers

You can choose not to compile the files. Go to the properties, and exclude the file from build.

like image 137
Rango Avatar answered Apr 26 '26 22:04

Rango


No. In a project, you cannot have multiple main() function.

You can rename them to test1(), test2(), test3(), and call them one by one from main(). That is what I do usually.

like image 42
Nawaz Avatar answered Apr 26 '26 22:04

Nawaz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!