Anonymous user
Write entire file: Difference between revisions
→{{header|C}}: more variants
(→{{header|C}}: more variants) |
|||
Line 80:
=={{header|C}}==
===
<lang C>/*
* Write Entire File -- RossetaCode -- dirty hackish solution
*/
#define _CRT_SECURE_NO_WARNINGS // turn off MS Visual Studio restrictions
#include <stdio.h>
int main(void)
{
return 0 >= fputs("ANY STRING TO WRITE TO A FILE AT ONCE.",
freopen("sample.txt","wb",stdout));
}
</lang>
=== Standard function fwrite() ===
<lang C>/*
* Write Entire File -- RossetaCode -- ASCII version with BUFFERED files
Line 180 ⟶ 192:
}
</lang>
=== POSIX function write() ===
<lang C>/*
|