How could I read let\'s say 10 floats and store them in an array without wasting any memory?
float arr[10];
for(i = 0; i < 10; i++){
scanf("%f", &arr[i]);
}
I know, it's like the above, but doesn't use the extra int in case it's not optimized out. hehe
To use even less memory us the code below. They're all read into an array, but only the last one to be read in is in the array:
float arr[1];
for(i = 0; i < 10; i++){
scanf("%f", &arr[0]);
}