read equivalent for filebuf?

前端 未结 4 724
萌比男神i
萌比男神i 2021-01-27 05:39
typedef struct {
  char c[20];
  int i;
} header;

void foo(std::string s) {
  std::ifstream ifs(s.c_str(), std::ios_base::binary | std::ios_base::in);
  if (ifs) {
             


        
4条回答
  •  南方客
    南方客 (楼主)
    2021-01-27 05:42

    what is the point of filebuf ?

    None, here.

    I can't see why you're using it.

    Until you do more complex operations, filebuf is an implementation detail.

    (Sort of.)

提交回复
热议问题