In the following codes why I have to put "ifstream::" before "binary". Since the "open" is already a method of ifstream and I am also using std namespace why do I need to put it this way "ifstream::binary" and "binary" alone does not work.
You should probably just use std::ios::binary. You have to qualify it because it cannot be found otherwise. ADL (argument-dependent lookup) only applies to functions.