I can't understand. why 2nd is giving error citing that "begin is not defined in scope?"??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I can't understand. why 2nd is giving error citing that "begin is not defined in scope?"???

1st code int create_array[]{100,200,300,400,500}; int *arr{nullptr}; arr = create_array; for(int i{0} ; i<5 ; i++) cout << arr[i] << endl; 2nd code int create_array[]{100,200,300,400,500}; int *arr{nullptr}; arr = create_array; for(int n: arr) //while create_array in place of arr =>fine cout << n << endl;

27th May 2021, 10:33 AM
saurabh
saurabh - avatar
0 Answers