Is it bad practice to use C features in C++?

前端 未结 10 1934
悲哀的现实
悲哀的现实 2021-02-19 00:16

For example printf instead of cout, scanf instead of cin, using #define macros, etc?

10条回答
  •  我在风中等你
    2021-02-19 00:44

    I would say the only ones that are truly harmful to mix are the pairings between malloc/free and new/delete.

    Otherwise it's really a style thing...and while the C is compatible with the C++, why would you want to mix the two languages when C++ has everything you need without falling back?

提交回复
热议问题