WriteString
This function writes a string to a stream and adds the null character at the end.
Syntax
- void WriteString(const std::string& s)
Parameters
- s: the string value to write.
Example
#include "Leadwerks.h"
using namespace Leadwerks;
int main(int argc, const char *argv[])
{
std::string path = "MyFile.dat";
Stream* stream = FileSystem::WriteFile(path);
if (stream==NULL) Debug::Error("Failed to write file.");
stream->WriteString("Hello!");
stream->Seek(0);
System::Print(stream->ReadString());
stream->Release();
return 0;
}