2.2.5.1.14 file::SeekToBegin

Description

Sets the file pointer value to the beginning of the file. This is the same as file::Seek(0, file::begin).

Syntax

void SeekToBegin( )

Parameters

Return

Examples

EX1

void file_SeekToBegin_ex1()
{
	file ff("C:\\float.txt", file::modeCreate | file::modeWrite);
	vector<float> vf(5);
	for ( int ii = 0; ii < vf.GetSize(); ii++ )
		vf[ii] = ii*1.25;
	ff.WriteFloat(vf, sizeof(float), vf.GetSize());

        LONG lFileSize = ff.Seek(20, file::begin);    // lCurrent = 20.
		lFileSize = ff.SeekToBegin(); // Go to the beginning of the file.
        ff.Close();
}

Remark

See Also

file::GetPosition, file::Seek, file::SeekToEnd

Header to Include

origin.h