Files provide a way to persistently store data on secondary storage like disks even when a computer is powered off. To use files, data is first written to a file from memory using functions like fopen(), fprintf(), fputs() which open, write to and close files. The data can later be read from the file into memory using functions like fopen(), fscanf(), fgets() when needed. Command line arguments passed when a program is executed are available in the main() function via argc and argv parameters, and can be accessed as strings and converted as needed using functions like sscanf().