I am just not really understanding this code. Apparently it creates a file, called file2.txt (which is SO cool). But what is Filein, Fileout, and Mychar? What do the do? I can see that MYCHAR goes to FILEOUT and is written to FILE2.TXT, but what does FILEIN in do? Is there a way to read input from a user and create a file? Can someone just explain the code to me? Like comment it and show what it does?
Thanks! All help is appreciated!
mychar : char;
filein, fileout : text;
assign (filein, 'c:file1.txt');
assign (fileout, 'c:file2.txt');
read (filein, mychar);
write (fileout, mychar);