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

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.