FILE *f;
f=fopen("recinfo.txt","rb+");
надо уменьшить размер файла на 1 байт.
Z>Z>FILE *f;
Z>f=fopen("recinfo.txt","rb+");
Z>
Z>надо уменьшить размер файла на 1 байт.
смотри в сторону:
#include <unistd.h>
#include <sys/types.h>
int ftruncate(int fd, off_t length)
или
int truncate(const char *path, off_t length);
только файл надо для записи открывать.
Но MSVC 6.0 не может открыть
#include <unistd.h>
fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
Error executing cl.exe.
Здравствуйте, zorky, Вы писали:
Z>Но MSVC 6.0 не может открыть
Z>Z> #include <unistd.h>
Z>
Z>fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
Z>Error executing cl.exe.
в windows'e не знаю, как делается, но
msdn тебе в помощь!
http://msdn.microsoft.com/en-us/library/aa365531(VS.85).aspx
Здравствуйте, zorky, Вы писали:
Z>fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
Z>Error executing cl.exe.
.....
LARGE_INTEGER pos = new_pos;
::SetFilePointer( file, pos.LowPart, &pos.HighPart, FILE_BEGIN );
::SetEndOfFile( file );
Здравствуйте, zorky, Вы писали:
Z>Z>FILE *f;
Z>f=fopen("recinfo.txt","rb+");
Z>
Z>надо уменьшить размер файла на 1 байт.
_chsize,_chsize_s
http://msdn.microsoft.com/en-us/library/kdfaxaay(VS.80).aspx