Please, don’t know how to add cpp file to MakeCode? When I add a file and enter the name custom.cpp, the name is changed to custom.cpp.ts.
c++ coding is not supported in the makecode webapp. you have to use the CLI for that: https://github.com/microsoft/pxt-mkc