1 year ago

#378330

test-img

Capplo

How can I find what's different between my laptop and my desktop, because I think all relevant compilers and IDE settings are the same?

first timer here!

This might seem like a really dumb question but I have tried a lot of different threads on this website already but without any luck... hope that someone might have an idea, thanks in advance!

I get an error on input n for the array below (image attached too):

int n, q;
cin >> n >> q;

long long BITree[n+1];

return 0;

Error shows: "expression must have a constant value C/C++(28)"

This error message has several posts on this website already however I am positive that this should work as I do not get this error when trying the same code on my laptop (also able to compile and run on the laptop).

Things that I've tried so far:

  • Checked all extension settings (as well as versions),
  • Checked all Visual Studio Code Settings (as well as version),
  • Checked that I am using the same compiler version
    • Currently using: g++ (Rev5, Built by MSYS2 project) 11.2.0

This has bugged me for quite some time and I have taken the long road of always using the other threads to solve it but I really want to find out why this is happening. Does anyone have any ideas or could link me to a more appropriate thread about fixing this?

Thanks again!

c++

visual-studio-code

input

g++

0 Answers

Your Answer

Accepted video resources