When we take input using for loop in array it scanf function uses '&' but without using for loop ,we use scanf '&' not require ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

When we take input using for loop in array it scanf function uses '&' but without using for loop ,we use scanf '&' not require ?

15th Nov 2019, 1:17 AM
Ankit Chaturvedi
Ankit Chaturvedi - avatar
1 Answer
+ 2
Yes you can do that but then you wouldn't be able to iterate over every index to provide values. int arr[5]; scanf("%d",arr); The above line still works.
15th Nov 2019, 2:06 AM
Avinesh
Avinesh - avatar