I want to change size of *.txt file, which is created before. For this i use chsize
.
Code:
#include <iostream>
#include <stdio.h>
#include <io.h>
using namespace std;
int main()
{
FILE *wfile;
wfile = fopen("test.exe", "a");
chsize(wfile, 1024); //error is here
file.close();
return 0;
}
And here goes the error:
[Error] invalid conversion from 'FILE* {aka _iobuf*}' to 'int' [-fpermissive]
Q: What is wrong here? I opened the file with fopen
right how it explained in the internets.
Q2: I love Windows as a OS, but I don't want to learn Windows API for C++ or something like that. Is there a option to use something portable?