Originally Posted by
blue_gene
int x;
cin>>x // surely " >>" is not a member function. how can i use this way ? is not it violating the acesses rule ? still it works..why?
the ">>" is the bitshift operator....so all you'd do, while creating the cin class/object, would be something like:
Code:
class cin
{
public:
operator >>;
}
I'm not sure if that's 100% correct, but it's close to it.
another question > how much it is important to close the file stream ? i have seen if i dont close the stream it really does not matter....no compile error.
No compiler error because the compiler doesn't care if it's closed or not. It's very important to close it though. Memory leaks, unable to access other files, etc... will PROBABLY occur if you don't close it.