Search:

Type: Posts; User: sean

Search: Search took 0.10 seconds.

  1. Thread: 2D array filling

    by sean
    Replies
    6
    Views
    4,957

    if (*(rod+k++) < *min) *min = *(rod+k++); ...

    if (*(rod+k++) < *min)
    *min = *(rod+k++);


    The ++ operator is dangerous when you use it like this. You're using it to mean "k+1" but it has side effects. The value of k will get incremented...
  2. Thread: 2D array filling

    by sean
    Replies
    6
    Views
    4,957

    Your loops are set up properly to iterate through...

    Your loops are set up properly to iterate through each possible combination of i and j, but then when you try to read or write a value, you're only using the current value of j, so you're basically...
Results 1 to 2 of 2