I saw this piece of code. I am quite new in C, so pardon me.
The while
loop below will keep looping if i < SIZE && scanf("%f",&Arr[i]) == 1
.
I get the i < SIZE
part but what does scanf("%f",&Arr[i]) == 1
mean?
I know it is taking in the value from scanf()
and assigning it to an array Arr
. But what does the == 1
means?
Thanks :)
int readValue(float Arr[]) {
int i = 0 ;
while (i < SIZE && scanf("%f",&Arr[i]) == 1)
i++ ;
return i ;
}