Even though my code is running correctly VS Code is highlighting it as an error. This started happening suddenly, until two hours back every thing was fine. I am compiling my code in C++.
void next_greater_element(int a[], int n)
{
int ans[n];
ans[n] is being highlighted as an error. The error says --
expression must have a constant value -- the value of parameter "n" (declared at line 102) cannot be used as a constantC/C++(28)