This is a strange question, but it's very frustrating to me.
In microsoft visual c++, when I open a cpp file, I can not compile it. Is there a specific way to open the file so that I can run it after opening? Thanks.

Recommended Answers

You can open and view source code files with Visual C++, but to build them they must first be part of a project.

Jump to Post

All 2 Replies

You can open and view source code files with Visual C++, but to build them they must first be part of a project.

If its just a single .cpp file and you want to quickly run it without building an entire project just for that single file, you can use the visual studio command line tool. In it, the command to compile is "cl". For more compiling options you may use this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.