n is a highly suspect name for a global variable. Did you accidentally declare a local variable n that was not an array? The global n would be hidden by the local n and you would get that error.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
>no, the only global variables i have are
Those are different from your first post.
>my locals:
I see an n that's declared as int.
>next = index + 1;
This line is trying to compute an offset from index and assign it to next, but next is not a pointer.
>last = tot_n - index;
Subtracting a pointer from an integer makes no sense.
>if (nums[index] > nums[next])
index is a pointer, not an integer. Array indices must be integral.
>tmp = nums[index];
This is the same problem.
>nums[index] = nums[next];
And here as well.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
Don't go hijacking other people's threads. I already answered your question in your previous thread.
John A
Vampirical Lurker
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
So kid, try to be modest instead acting smart. This kind of attitude won't fetch you any help.
Thread closed.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734