Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 01:42:24 +0000



Post From: Is it possible to use sc.WriteFile() to write in text mode?

[2018-12-10 15:30:42]
User287992 - Posts: 51
int FileHandle;
sc.OpenFile("Testing.txt", n_ACSIL::FILE_MODE_CREATE_AND_OPEN_FOR_READ_WRITE, FileHandle);
unsigned int * p_BytesWritten = 0;
sc.WriteFile(FileHandle, "Test", sizeof("Test") - 1, p_BytesWritten);
sc.CloseFile(FileHandle);

Writes Test correctly. But

sc.WriteFile(FileHandle, "Test", sizeof("Test"), p_BytesWritten);

writes 5465 7374 00.

Why is sizeof off by one byte?