Coding Exercises: File IO
saveStrings() function
Write a Processing-style saveStrings() function that
saves an array of Strings to a file:
void saveStrings(String filename, String[] data)Note: see the write_data() function in the HelloFile
example in this chapter.
FileHelper class
Write a class FileHelper that contains the two
Processing-style functions loadStrings() and
saveStrings() as static member functions.
class FileHelper
{
static String[] loadStrings(String filename)
{
// ...
}
static void saveStrings(String filename, String[] data)
{
// ...
}
}Write a test program to test your FileHelper
functions.