Home > Software engineering >  C detect file included by other files
C detect file included by other files

Time:11-11

I'm using visual studio code and C . And am including .cpp files in other .cpp files (don't try at home).

In the included .cpp file, I have code that depends on variables and functions within the .cpp file including that file. All compiles good, but the syntax highlighting can't understand this and marks everything as red lines.

Setting aside coding standards, is it possible to get syntax highlighting to see inside the file including that file whilst maintaining the files in the same compilation unit and so can see that the dependencies of the included file is in fact met.

CodePudding user response:

Visual studio code should do this for you. Click on the "file including the file" and then click back to the included file and you should see no errors. Since this is not a standard way of programming, there is not much support on this topic.

  • Related