Question

I am in a C++ class and my professor has given us some starter code to implement a graph.

She has given us a .template file and wants us to run it in Visual Studio 2012, however VS2012 doesn't seem to recognize the .template file as C++ code so does not color the C++ reserved words at all.

The program still compiles and runs, but it is more difficult to code when I can't see any of the reserved words in color. Is there any way to make VS2012 color the reserved words in .template files?

Was it helpful?

Solution

Sure. Just rename it to have a .cpp extension.

Or, alternatively, Visual Studio offers functionality that will allow you to map a custom extension to a particular editing experience. Go into your Visual Studio options and navigate to Text Editor > File Extension.

Visual Studio  loading= Options > Text Editor > File Extension">

Here, you can add template as a file extension and map it to the Microsoft Visual C++ editor.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top