Almost all languages have a foreach loop or something similar. Does C have one? Can you post some example code?
C does not have an implementation of for-each. When parsing an array as a point the receiver does not know how long the array is, thus there is no way to tell when you reach the end of the array.
Remember, in C int* is a point to a memory address containing an int. There is no header object containing information about how many integers that are placed in sequence. Thus, the programmer needs to keep track of this.
However, for lists, it is easy to implement something that resembles a for-each loop.
for(Node* node = head; node; node = node.next) {
/* do your magic here */
}
To achieve something similar for arrays you can do one of two things.
The following is an example of such struct:
typedef struct job_t {
int count;
int* arr;
} arr_t;