I am making a c program that can save matrices and vectors in CSV files so I can then perform operations between them. In one of my functions I create a matrix with random numbers and then save it inside a CSV file.
The problem is that I don't know how to create a different file every time the function is run so each array can be stored in a different CSV file. Because of this I have to save all the matrices inside the same file which makes the rest of the process a lot harder. How could I make the function that makes a different file every time without it having completely random names.
Here is a link to the project in replit
matrix5325.csv. When the program starts, it should scan the directory to see which files already exist, and then use the first available number for the new file. Or you could find the largest number already used, and add 1.snprintflook here: stackoverflow.com/questions/5172107/…