Home > Software design >  does DEVC/DEVC IDE not support vectors
does DEVC/DEVC IDE not support vectors

Time:01-15

#include <bits/stdc  .h>
using namespace std;

int main()
{
    vector<int> vect1(10);
    int value = 5;
    fill(vect1.begin(), vect1.end(), value);
    for (int x : vect1)
        cout << x << " ";
}

this does not compile in dev c and shows error.. i directly copied this code from gfg--> link is enter image description here

Click on Compile Options: enter image description here

Click on Settings: enter image description here

Click on Code Generation: enter image description here On language standards, choose "ISO C 11" enter image description here

But you shouldn't use Dev C anymore.

CodePudding user response:

The problem is not the compiler. The #include <bits/stdc .h> is a standard header which most of the sites use in their example codes and it includes a lot of other c header files but this is not defined in any C standard and not recommended at all because all compilers doesn't support it and it effects the portability of the code.

Here is the detailed explanation of this: Why should I not #include <bits/stdc .h>?

  •  Tags:  
  • Related