Sergey Kalinichenko
Sergey Kalinichenko

Reputation: 726809

Treat files with .C extensions as C++ in Visual Studio Code

Is it possible to configure VS Code plugin for C/C++ to treat .C files as C++ code? The icon in the explorer on the left correctly indicates that my files with .C extension are C++, but intellisense treats C++ constructs inside these files as errors. Renaming the file to .cpp avoids this problem. Is there a configuration setting that would let me specify that .C extension corresponds to C++ code?

Upvotes: 3

Views: 2044

Answers (1)

Sergey Kalinichenko
Sergey Kalinichenko

Reputation: 726809

Make a file association for C extensions to map to C++ as follows:

  1. Open settings (Ctrl+,) and scroll down to Files:Associations.
  2. Click [Add Item]
  3. Type *.C for the key and cpp for Value
  4. Click [OK]

Upvotes: 4

Related Questions