Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C Programming- Calling elements in Arrays question.
#3
data[abs(i)][0] causes it to crash because it returns a double, while array indices expect a size_t, consider casting it to an int.

data[(int)abs(i)][0]

Disregarding the fact why the indices are negative to begin with.
Reply


Messages In This Thread
C Programming- Calling elements in Arrays question. - by Locked - 2013-04-02, 08:22 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)