Do I have to use #include beside ?

后端 未结 2 1340
时光说笑
时光说笑 2020-11-29 06:23

I started learning C++ and I read a book which writes that I must use the header file because the string type is not built directly into the comp

2条回答
  •  死守一世寂寞
    2020-11-29 07:07

    Yes, you have to include what you use. It's not mandated that standard headers include one another (with a few exceptions IIRC). It might work now, but might fail on a different compiler.

    In your case, apparently includes , directly or indirectly, but don't rely on it.

提交回复
热议问题