source: driver/tests/test7.c

Last change on this file was 3067, checked in by sacerdot, 7 years ago

New test that fails too.

File size: 429 bytes
Line 
1char a[] = {3, 2, 7, 1};
2char treshold = 4;
3
4unsigned int count(char(*foo)(char),char *a,int current, int high) {
5        int n = 0 ;
6        if (current < high)
7        {
8                n = (*foo)(a[current]);
9                current++;
10                n += count(foo,a,current,high);
11        }
12        return n;
13}
14
15char smaller(char x) {
16        return (x < treshold);
17}
18
19int main() {
20        return (count(smaller,a,0,4));
21}
Note: See TracBrowser for help on using the repository browser.