when I run this
#include <cstdio>
#include <iostream>
using namespace std;
int len(int arr[]) {
int size = 0;
for (int x : arr) {
size = size + 1;
}
return size;
}
int main() {
int test[] = {4,7,13,25,79,2};
cout << len(test);
}
it says
test.cpp: In function 'int len(int*)':
test.cpp:7:18: error: 'begin' was not declared in this scope
for (int x : arr) {
i have been trying to fix this hours and i can not find what is wrong. why is this and how am i supposed to fix this.