#include <iostream>
int main() {
using namespace std;
int arr[] = {1,2,3,4,5 };
//for (int i = 0; i < 5; i++) {
// cout << arr[i] << " ";
//}
for (auto x : arr) {
cout << x << " ";
}
//for (auto x : { 1,2,3,4}) {
// cout << x;
//}
int *beg = std::begin(arr); //arr
int *end = std::end(arr) ;
//auto &&range = arr ;|
//auto begin = std::begin (range) ;
//auto end = std::end (range) ;
//for(; begin = end; ++begin) {
//auto v= *begin;
//}
cout << endl << "output buff: ";
while(beg != end) {
std::cout << *beg << " ";
++beg;
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: