Issue
For example, if this is in a C file:
#include <stdio.h>
int main() {
puts(R"(PREPROCESSOR DIRECTIVES
The following are the preprocessor directives in C:
#define - Replaces parts of the code. Non-function macros are usually named in UPPERCASE.
#include - Inserts a header file into the current file.
#ifdef - Runs more preprocessor directives below until reaching an #endif, if something is defined.)");
}
it probably has bad practices I just made this quickly
It runs fine, but vscode bombards me with 7 useless errors. Sure, vscode lets it compile, but it's just annoying to see your errors tab full of fake errors. How can I fix it?
- identifier "R" is undefined
- missing closing quote
- expected an identifier (2)
- expected a file name
- the #endif for this directive is missing
- expected a ";"
My question is "how can I make vscode not throw errors about raw strings" not "how can I make C have raw strings" if it wasn't clear already
Solution
Raw strings are not standard C. I see they are accepted by gcc so that seems to be a gcc extension. What is happening is that you compile with gcc, but realtime error highlight system (intellisense, squiggles, whatever it is called) uses either a clang based solution or Visual Studio one.
Answered By - bolov Answer Checked By - David Goodson (WPSolving Volunteer)