skip to Main Content

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


  1. 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 🙂

    Login or Signup to reply.
  2. is it quoting the ISO Standard?

    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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search