Define your own istream type : istream « File Stream « C++ Tutorial






#include<iostream.h>
#include<string.h>
istream & skipchar(istream &stream)
{
  int i;
  char c;
  for(i=0;i<5;i++) stream>>c;
  return stream;
}
main()
{
  char str[80];
  cout<<"Enter some characters:";
  cin>>skipchar>>str;
  cout<<str<<'\n';
  return 0;
}
Enter some characters:q
w
e
r
t
r
r








12.13.istream
12.13.1.Oct Input stream
12.13.2.Define your own istream type