Let’s say I write a faulty piece of code in C++, such as:
const int x;
VS Code’s IntelliSense will throw an error of the type:
const variable "x" requires an initializer C/C++(257)
I am curious what the error code between parentheses (here 257
) refers to – is it quoting the ISO Standard?
2
Answers
The problem in your code is that consts cannot be uninitialized. The variable ‘x’ is a constant and connot be nill. if you have any further questions, ask me 🙂
No, it is not referring the ISO standard when it uses
257
.Instead it is referring to its own internal error code 257. VSCode has different error codes for different errors. Different error code list for vscode should be available at their official site.