saveStrings()
Output / FilesDescription
Writes an array of strings to a file, one per line.
Syntax
bool saveStrings(std::string path, std::vector<std::string> lines)
Parameters
| Name | Type | Description |
|---|---|---|
| path | std::string | path to write to |
| lines | std::vector | strings to write |
Returns
boolRelated
Under the Hood
From Processing.h:
inline bool saveStrings(const std::string& path, const std::vector<std::string>& lines) {
std::ofstream f(path); if (!f) return false;
for (auto& l:lines) f<<l<<"\n";
return true;
}
static bool saveStrings(const std::string& path, const std::vector<std::string>& lines);
Under the Hood
From Processing.cpp:
bool PApplet::saveStrings(const std::string& path, const std::vector<std::string>& lines) {
std::ofstream f(path); if (!f) return false;
for (auto& l : lines) f << l << "\n"; return true;
}