How could I read let\'s say 10 floats and store them in an array without wasting any memory?
sounds like homework.
read the number of floats from the input. multiply that by the size of an individual float allocate that exact number of bytes storing the address in a pointer to floats have a loop read in the floats from the input have a loop that adds up all the floats in the array
My guess here is the homework lesson is to realize the connection between the term pointer and array, although you can do this without any array indexing, but your question implies that you have to use an array.