This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/cplbexam/iostream/ostream/tellp.cpp

16 lines
365 B
C++

#include <iostream.h>
#include <fstream.h>
void main( void ) {
char ch;
fstream test ( "temp.txt", ios::in|ios::out );
for( int i = 'A'; i <= 'L'; i++ ) {
test << ( ch = i );
cout << ch << " "
<< "Next character will be written in \"temp.txt\" at position: "
<< test.tellp() << endl;
}
}