-2

I have simply created an Array a using container class. However, VScode's IntelliSense is showing an error. Here's an implementation of selection sort.

![IntelliSense Error

the contents of the c_cpp_properties.json file are as follows

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.16299.0",
            "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.13.26128/bin/Hostx64/x64/cl.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "msvc-x64"
        }
    ],
    "version": 4
}

the code compiles and runs successfully. How do I fix the incorrect IntelliSense error?

Ani
  • 2,848
  • 2
  • 24
  • 34

1 Answers1

7

Stop including bits/stdc++.h.

That's an implementation header for some toolchains. It's not for you.

Include the proper header instead:

#include <array>

(It's likely that your Intellisense engine does not have access to this internal header from Linuxy platforms.)

By the way, you're not allowed to choose names that begin with two underscores. So stop that too.

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
  • Yes. The compiler intellisense uses does not have `bits/stdc++.h` and including `array` fixed it. However removing __ from the macro didn't fix the error – Ani May 21 '19 at 16:22
  • I didn't say removing `__` would fix the error, I said you're not allowed to use it. It could break in the future. Honestly this should have been covered by your book :/ – Lightness Races in Orbit May 21 '19 at 16:23
  • ***However removing __ from the macro didn't fix the error*** That can cause other problems. – drescherjm May 21 '19 at 16:23
  • @drescherjm yes. It did. Thank you. I will fix it. – Ani May 21 '19 at 16:23