I need to write a program that calculates the squares of all numbers that are contained in a file of floating point numbers. The obtained new numbers form a new file. Like this : if the file contains the numbers 1, 2.5, 0.1, the numbers 1, 6.25 and 0.01 form the resulting file. The file names are specified on the command line:
square data.txt squares.txt
c++ on unix if this is important