Expression cannot be used a function

    while (a[i] >=0)
		f = max (f, a[i]);

Here, a is a vector, I’m just trying to find out max element in a contiguous subarray of positive elements, but its showing error in max function i.e ( Expression cannot be used a function )
What type of error is this?

Please post the full code (with formatting, of course :)) :slight_smile:

1 Like

Most probably you have already declared max as a macro. So just remove your #define max line, then it won’t give this error.


Yes,I’ve done the same mistake,its running now. Thankyou.

Thankyou for the response. Its solved now :slight_smile:

1 Like