Visual Studio Code – C++ auto formatter changes > > to >>

  • A+

I'm having a problem with the C++ extension of VScode. Whenever I define a matrix consisting of vectors like vector<vector<int> > and use the auto formatter, it changes the code to vector<vector<int>> which results in a compiler error.

Is there any solution to this?


VSCode C++ extension uses clang-format for formatting the document. If you are stuck with old compiler which doesn't supports C++ 11, just add a .clang-format file in your workspace with following line

Standard : Cpp03 

For more formatting options, refer to following link


:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: