undefined variable

Hello.
I am defining my variable outside my function quickSort() and when used it inside the function I get this error. Why is that?
Hi,

We need to see the code, there is not enough info in your question. Preferably something we can compile.

If you have errors, then post them here in full and verbatim. Make sure the line numbers match with your code.

Cheers :+)
This:

int count=0;
void quickSort(int a[],int base , int n)
{
...
count+=n-1;
....
}
You wouldn't happen to have using namespace std; and be using the algorithm header would you?

count exists in the std namespace.

As well as not using the entire std namespace, I prefer not to have variable names the same as the std ones.

Also:

TheIdeasMan wrote:
We need to see the code, there is not enough info in your question. Preferably something we can compile.

If you have errors, then post them here in full and verbatim. Make sure the line numbers match with your code.


And code tags, with 252 posts, I thought you might have been aware of that by now :+)
Topic archived. No new replies allowed.