int fgetpos(FILE* qpStream, fpos_t* qpPos);
#include <cstdio>
int main()
{
char* cpFileName = "XoaX.txt";
FILE* qpFile = fopen(cpFileName, "r" );
fpos_t iPos = 0;
// Get the initial position
int iResult = fgetpos(qpFile, &iPos);
if (iResult == 0) {
printf("Position: %i \n", iPos);
}
// Read the first byte of the file to advance the file pointer.
int iFirstChar = fgetc(qpFile);
// Get the position after the read
iResult = fgetpos(qpFile, &iPos);
if (iResult == 0) {
printf("Position: %i \n", iPos);
}
fclose(qpFile);
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.