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/istream/destruct.cpp

17 lines
366 B
C++
Raw Permalink Normal View History

#include <iostream.h>
void *operator new( size_t, istream *p ) { return( p ); }
void main( void ) {
char blob[512], buf[50];
istream *p = new ( blob ) istream ( cin );
(*p).width( 50 );
cout << "Enter a string:" << endl;
*p >> buf;
cout << "The string you have just entered:" << endl;
cout << buf << endl;
p->~istream();
}