I just started learning C ++, and I'm using Microsoft Visual Studio Express 2012. I started a project where I planned to have all my .cpp files, but now I have a problem when I try to compile and run a specific .cpp file, it doesnโt works.
VS seems to just compile and run the .cpp file with the main function in it, and it creates .exe and runs it. Since my first .cpp file (which contains main ()) is a simple hello world program, I only get this when I try to compile and run now.
I have another .cpp file with an int age () function, which should ask the user's age and then output it. It is very simple, and I just want to run it to see it in action, but I canโt figure out how to compile this particular .cpp file in my project, as it seems like it just wants to compile the main .cpp file with the main ( )
How can I compile a specific .cpp in a project?
source share