print files to file

In c, I have completely forgotten the correct syntax to use when trying to send a the list of files to a file. I know what it is in Unix, but not in c:

ls > file.txt
Topic archived. No new replies allowed.